--drop table #tmp_table SELECT name into #tmp_table FROM SysObjects Where XType='U' declare @table nvarchar(50) while exists (select top 1 * from #tmp_table) BEGIN select top 1 @table = name from #tmp_table if Exists (SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME=@table and COLUMN_NAME='SyncError') BEGIN declare @SQL NVARCHAR(200)= 'ALTER TABLE ' + @table + ' ALTER COLUMN SyncError NVARCHAR(MAX);' exec(@sql) END delete from #tmp_table where name=@table END
浙公网安备 33010602011771号