sqlserver: 使用While 示例
declare @i int
set @i = 1999
while(@i<2009)
begin
declare @sql varchar(8000)
set @sql = 'update
dbo.cltj'+ltrim(str(@i))+'
set ydw = ''Ten Thousand Tons'''
set @i = @i+1
exec(@sql)
end
declare @i int
set @i = 1999
while(@i<2009)
begin
declare @sql varchar(8000)
set @sql = 'update
dbo.cltj'+ltrim(str(@i))+'
set ydw = ''Ten Thousand Tons'''
set @i = @i+1
exec(@sql)
end