About Me

My photo
a Dynamic and Energetic guy.....

Wednesday, October 6, 2010

SQL Update query with inner join, Script to add table columns

update tbladdress
set tbladdress.state=p.propertystate
from tbladdress as a
inner join tblproperty as p on a.relatedid=p.propertyid
where (a.state is null or a.state='')
      and a.relatedtable='tblProperty'
      and (p.propertystate is not null and p.propertystate <> '')

ADD CreatedDate     datetime,
CreateBy        int,
ModifiedDate     datetime,
Modifiedby      int 


No comments:

My Masters