declare  cursor1 cursor for select d.name from syscolumns a, sysobjects d where a.id=d.id and d.xtype='U' and a.name='工作单位'
declare
@i varchar(1000)
open cursor1
fetch cursor1 into @i
while @@fetch_status=0
begin
  exec('update '+@i+' set 工作单位=''人事处'' where 工作单位=''人事管理部''')
  fetch cursor1 into @i
end
close cursor1
deallocate cursor1

解决方案 »

  1.   

    一个一个表update 楼主最好把几个表的关联结构列出来。
      

  2.   

    to  txlicenhe(马可):  存的是代码就好了,现在没办法了,所以来求救了。
      

  3.   

    to  lvltt(未完成@与星俱进@Whowhowho) :
    表太多了,有的有联系,有的之间没有联系,但可能就用到工作单位这一字段,我也头疼呀,接的是以前别人做的程序。
      

  4.   

    --一句可以搞定:exec sp_MSForEachTable 'update ? set 工作名称=''人事处'' where 工作名称=''人事管理部'''