常用的TSQL语句

循环插入表数据

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

原文地址:https://www.cnblogs.com/jiguixin/p/2607808.html