来至:gotesting软件测试联盟论坛 http://www.78test.com
declare @i
int
set @i=1
declare @CodeNum
bigint
set @CodeNum=1
while (@i<=1000)
begin
declare @SQL varchar(8000)
set @SQL=''
set @SQL='INSERT INTO 表名
VALUES
( NULL ,
'''+Convert(varchar,@CodeNum+@i)+''',
''张三'+CONVERT(varchar,@i)+'''
)'
set @i=@i+1exec (@SQL)
end