Batch Data Update

  • 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

  • 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

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • 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