sqlserver中循环生成记录

declare @i int
set @i=1
while(@i<=10)
begin
INSERT INTO [BMData].[dbo].[QueryBlackListLogs]
           ([ID]
           ,[LoginUserID]
           ,[QueryTime])
     VALUES
           (newid()
           ,'FEE1D95B-5FC3-4F9C-8D29-C6058978A7D6'
           ,GETDATE()
        )
set @i=@i+1
end

 

posted @ 2017-04-21 15:13  幸福安康  阅读(342)  评论(0编辑  收藏  举报