Sunday, February 2, 2014

Table update


merge Main.[dbo].[Employee_details_Master] target
Using Demo.[dbo].[Employee_details] src On target.id=src.id
When Matched Then Update
Set NAME=src.Name, ADDRESS=src.Address, Mobile=src.Mobile
When Not Matched Then
Insert (ID, NAME, ADDRESS, Mobile)
Values (src.ID, src.NAME, src.ADDRESS, src.Mobile);


No comments:

Post a Comment