SQL Server循环插入数据


--循环执行插入10000条数据
declare @ID int
declare @eigyousyocode nvarchar(16)
declare @datet datetime
declare @placecode nvarchar(16)
begin
set @ID=1
set @eigyousyocode='1'
set @datet='2015-05-06 17:22:24.990'
set @placecode='1'
while @ID<=50000
begin
insert into bs_WorkView(eigyousyo_code,date_t,place_code)
values(@eigyousyocode,@datet,@placecode)
set @ID=@ID+1
end
end

转载于:https://www.cnblogs.com/dehuachenyunfei/p/10442106.html

你可能感兴趣的:(SQL Server循环插入数据)