select a.[id], a.[name],b.name, 'UPDATE '+ a.name+ ' SET Nd=''2015''' + ' where Nd=''2014''' from [sysobjects] a left join [syscolumns] b on a.id=b.id where a.[type] = 'u' and b.name='Nd' order by a.name
查询出数据,拼出SQL字符串,然后执行它
select a.[id], a.[name],b.name, 'UPDATE '+ a.name+ ' SET Nd=''2015''' + ' where Nd=''2014''' from [sysobjects] a left join [syscolumns] b on a.id=b.id where a.[type] = 'u' and b.name='Nd' order by a.name
查询出数据,拼出SQL字符串,然后执行它