Search This Blog

Monday, March 4, 2019

Sql table update from one table to other table based on Primary key (ID match both table)


Sql table update from one table to other table based on Primary key (ID match both table)

We have 2 table custmain & custdetail I want update custmain email ID by custdetail emailID.









UPDATE  Custmain
SET
    Custmain.EmailID = CD.uEmailID,Custmain.Name=CD.Fname

FROM
    Custmain as CM

INNER JOIN

    CustDetail as  CD
ON 
    CM.Csid=CD.CsIDU




 







No comments :