About Me

My photo
a Dynamic and Energetic guy.....
Showing posts with label Script. Show all posts
Showing posts with label Script. Show all posts

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 <> '')

================================================================
ALTER TABLE SPORT
ADD CreatedDate     datetime,
CreateBy        int,
ModifiedDate     datetime,
Modifiedby      int 


================================================================

My Masters