用游标
declare @name varchar(50), @sql nvarchar(200)
declare cur cursor for select name from sysobjects where xtype='U'
open cur
fetch next from cur into @name
while @@fetch_status=0
begin
set @sql='alter table '+@name+' add column Field1 int'
exec sp_executesql @sql
fetch next from cur into @name
end
close cur
deallocate cur