常用的T-SQL语句

 

循环插入表数据

declare @i int

set @i = 1;

while(@i <= 31)

begin



insert into dbo.GoldOrders(OrderID,GoldCount,CharacterName)values(@i,

22+@i,'jimji'+CONVERT(nvarchar(50),@i)

)

set @i = @i +1;

end

你可能感兴趣的:(sql语句)