Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Learn about SQL Server DBA, SQL Server database performance,SQL Server optimisation,database tuning,t-sql,ssis
Browse by Tags · View All
DBA Scripts 51
performance 37
SQL Server 29
Object Management 24
#SQLServer 24
Backup and Restore 20
Security Management 20
Powershell 17
Indexes 14
DBA 14

Archive · View All
June 2011 38
January 2011 33
May 2011 32
August 2011 27
July 2011 26
January 2012 24
February 2011 19
April 2011 19
March 2011 17
March 2012 17

Jack Vamvas's Blog

T-SQL UPDATE JOIN on a table

Jun 10 2011 7:56AM by Jack Vamvas   

SQL Server T-SQL UPDATE with JOIN on a table – is a simple task. Follow the pattern below. The example below takes values from one table and updates on another table – based on the JOIN between the two columns

--create #temp1_guitarists , with missing values on song column
CREATE TABLE #temp1_guitarists
(guitarist_ID INT,
 guitarist_name VARCHAR(50),
 song VARCHAR(50)
);

--create #temp1_guitarists_song  , with songs
CREATE TABLE #temp1_guitarists_song
(guitarist_ID INT,
 song VARCHAR(50)
);

 --insert values
INSERT INTO #temp1_guitarists
SELECT 1,'Joe Satriani','' UNION
SELECT 2,'Jimi Hendrix','' UNION
SELECT 3,'Prince',''; 

INSERT INTO #temp1_guitarists_song
SELECT 1,'Satch Boogie' UNION
SELECT 2,'Red House' UNION
SELECT 3,'When Doves Cry';

--Now , for the UPDATE statement
UPDATE #temp1_guitarists SET song = B.song
FROM #temp1_guitarists AS A
INNER JOIN #temp1_guitarists_song AS B
ON A.guitarist_ID = B.guitarist_ID;

--display the changes
SELECT guitarist_ID,guitarist_name,song 
FROM #temp1_guitarists;

--clean up temp tables
DROP TABLE  #temp1_guitarists;
DROP TABLE #temp1_guitarists_song;

Republished from http://www.sqlserver-dba.com.


Republished from SQL Server DBA [65 clicks].  Read the original version here [32134 clicks].

Jack Vamvas
5 · 27% · 8528
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]