方法一:
使用整数直接循环法:
DECLARE @I INT
SET @I=0
WHILE @I < 10000
BEGIN
INSERT INTO YOURTABLE(COLOUMN1, COLOUMN2) VALUES(@I, 'TEST')
SET @I = @I+1
END
方法二:
插入以时间为变量的数据
DECLARE @I INT
DECLARE @DT DATETIME
SET @I = 0
SET @DT = '2000-1-1'
WHILE (@I < 100000)
BEGIN
WAITFOR DELAY '000:00:02'
INSERT INTO TESTTABLE(COLOUMN1,COLOUMN2) values('TEST',@DT)
SET @DT = @DT + 1
SET @I = @I + 1
END
参考:SQL批量循环插入数据 http://www.cnblogs.com/chengbin/articles/805545.html