declare @i int set @i = 1 while @i <= 10 begin insert into table1 select top 1 * from table1 set @i= @i+1 end
insert into 表名(字段) select 字段 from 表名 where 条件 例如: insert into YIEN_TempletePreconfig(YIPCID,YITSerialNum,YITCProjectName) select 2,YITSerialNum,YITCProjectName from YIEN_TempletePreconfig where YITSerialNum='Com_001' OSQL: insert into table() values() select ... go 10000
set @i = 1
while @i <= 10
begin
insert into table1 select top 1 * from table1
set @i= @i+1
end
例如:
insert into YIEN_TempletePreconfig(YIPCID,YITSerialNum,YITCProjectName) select 2,YITSerialNum,YITCProjectName from YIEN_TempletePreconfig where YITSerialNum='Com_001'
OSQL:
insert into table() values()
select ... go 10000
这样就行!用while循环插入!