什么意思啊?alter table table1 add id int identity(1,1)
alter table table2 add id int identity(1,1)
alter table table3 add id int identity(1,1)
alter table table2 add id int identity(1,1)
alter table table3 add id int identity(1,1)
declare crs cursor for
select name from sysobjects where xtype='U'and name<>'dtproperties'
open crsfetch next from crs into @tablename
while(@@fetch_status<>-1)
begin
exec ('alter table '+@tablename+' ADD [ID] INT identity(1,1)')
fetch next from crs into @tablename
end
close crs
deallocate crs