标签:select pre 赋值 int arch creat user bsp ica
DECLARE @i int ,@project varchar(50),@title varchar(50) ,@userName varchar(50),@userRowGuid varchar(50) select @i=0 ,@project=‘dt20180328-3e44-4870-a2c3-2e7aa0932dce‘, @title=‘mmmmmm‘,@userName=‘‘,@userRowGuid=‘1d2629ce-e521-4196-a25b-c86d3edfdd41‘ ---->给变量赋值,i为循环条件,此处为0 while @i<10 ---->i每次循环后加1,直到i大于10 begin ---->开始执行sql INSERT INTO [BIMPM_Document].[dbo].[ArchivesFileCategory] ( [RowGuid],[ProjectRowGuid],[ParentRowGuid],[Title],[Description],[SortOrder],[CreateUserRowGuid],[CreationDate],[LastModificationDate],[Type]) values(Newid(),@project,‘‘,@title,‘‘,1,@userRowGuid,GETDATE(),GETDATE(),1) - SELECT @i=@i+1 ---->sql执行完,变量递增 END
标签:select pre 赋值 int arch creat user bsp ica
原文地址:https://www.cnblogs.com/wangzuofei/p/13183649.html