Click here to Skip to main content
16,013,207 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
update matrimony_Personaldetails mp1 inner join matrimony_register as mr set Profilecreatedby='self',Name='rajeesh',Height='5 ft-4in-165' from matrimony_Personaldetails mp1,matrimony_register mr select mp1.Profilecreatedby,mp1.Name,mr.Height from dbo.matrimony_Personaldetails as mp1 left outer join dbo.matrimony_register as mr on mr.Reg_id=mp1.Reg_id where mp1.Reg_id='34'
Posted
Updated 2-Jun-14 22:47pm
v4
Comments
Prasanth Radhakrishanan 3-Jun-14 4:50am    
in a single query is difficult but using two query i got solution . some body tell easy way ? any body can help ? update and select

1 solution

SQL
begin
begin TRANSACTION

   update matrimony_Personaldetails set Profilecreatedby='self',Name='manu'FROM matrimony_Personaldetails mp1 inner join matrimony_register mr on mr.Reg_id=mp1.Reg_id where mp1.Reg_id=@regId

   update matrimony_register set Height='5 ft- 4in' from matrimony_register mr INNER JOIN matrimony_Personaldetails mp1 ON MR.Reg_id=mp1.Reg_id where mp1.Reg_id=@regId
       commit
        select mp1.Profilecreatedby,mp1.Name,mr.Height from dbo.matrimony_Personaldetails as mp1 left outer join dbo.matrimony_register as mr on mr.Reg_id=mp1.Reg_id where mp1.Reg_id=@regId
 
Share this answer
 
Comments
Prasanth Radhakrishanan 3-Jun-14 4:51am    
this is worked but we need short

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900