可以同时多个执行可以,加快速度
BEGIN DECLARE @i int SET @i = 1 WHILE (@i <=10000000) BEGIN INSERT INTO T_TagRecod (TagNo,ScanCtn,StatusTag,JyuchuNo,InUserNo,InDateTime,DeliveryNo,OutDateTime,OutUserNo) VALUES( 'PPPSS'+convert(varchar(20),@i) ,2 ,1 ,'Jyu'+CONVERT( CHAR(12), cast(ceiling(rand() * @i*10) as int) ) ,'admin' ,GETDATE() ,'Deli'+CONVERT( CHAR(12), cast(ceiling(rand() * @i*10) as int) ) ,GETDATE() ,'admin') SET @i = @i + 1 END END