根据表1更新表2的数据

1.多个字段更新

 update p set   p.CityArea=p1.CityArea,     p.Spell=p1.Spell,    p.Abbr=p1.Abbr,      p.Sort=p1.Sort     

from Area p , Areabak20120718 p1      where p.ID =p1.ID

2.单个字段更新

Update productDetail  set Mtitle = (select [name] from product where id = productDetail.productid )

3.根据表2删除表1

 delete Product_@i from  Dealers d where d.dealerid= Product_@i.dealerid  and  d.LastLoginTime  <''2012-07-01 00:00:00'' ;

posted on 2012-07-19 12:36  bobo327  阅读(288)  评论(0编辑  收藏  举报