SQL SERVER 批量插入记录
--create function insertData(@count as int,@tsn as bigint,@id as int) --as --begin SET IDENTITY_INSERT Table_Name OFF declare @tsn bigint --这儿用int会溢出 declare @count int declare @id int set @count= 0 set @tsn = 678833010119069 set @id= 24982 while(@count<10) begin set @tsn=@tsn+1 set @id=@id+1 set @count=@count+1 Insert into Table_Name (Col-Name,....) values ( '0', '', @tsn, @tsn, '5', @tsn, '123456', @tsn, '1', '1', '', '', '', '0', '0', '0', '', '0', '0', '', '', '2015/7/4', '8', '0', '2016/7/4', '1190', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '1', '0', '2015/10/15 13:18', '2015/7/4 13:31', '053255678033', '', '', '120', '0', '1', '', 'a4bf5d7e-ce3d-47db-b899-eb2d665c0578', '1', '1', '0', '', '0', '1', '0' ) end
版权声明:本文为博主原创文章,未经博主允许不得转载。