July 24, 2012 at 5:57 am
Hello Friends
I have 2 tables
table 1 contains new data ( Empcode ,EmpName,Basicpay,DA)
table 2 contains old data ( Empcode ,EmpName,Basicpay,DA)
I want to update table2 with new data
Update Conditions
1.It should match EmpCode and EmpName in both tables
2.If it is matching update BasicPay and DA in table2 with new value in table1 with matching EmpCode and EmpName
3.If it is not insert the new value into table2
4.Update all the data in table2 with table 1 using a single query or a set of query.
If Anybody can help in this?
Nidheesh
July 24, 2012 at 7:18 am
You might want to read this posting and test if it applicable to your situation.
http://sqlserver-tips.blogspot.com/2006/09/mimicking-merge-statement-in-sql.html
July 24, 2012 at 11:36 pm
Hello I understood that post.Here i have to merge the value with certain conditions .That i need
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply