/////建表
DROP TABLE temp_c_s_y ;
CREATE TABLE temp_c_s_y
(tp_sh NUMERIC(18,0) NOT NULL,
tp_fz NUMERIC(18,0) NULL);
alter table temp_c_s_y
add constraint pk_tp_sh primary key nonclustered (tp_sh) ;
declare @i NUMERIC(18,0) /////建变量i
declare @f NUMERIC(18,0) /////建变量f
set @i=0 //////
set @f=1
while @i<12
begin
if @i>=0 then
insert into temp_c_s_y
select tp_sh,tp_fz
from temp_c_s_y
set @i=@i+1 //////
set @f=@f+1
else
end if
end
select * from temp_c_s_y ;
DROP TABLE temp_c_s_y ;
CREATE TABLE temp_c_s_y
(tp_sh NUMERIC(18,0) NOT NULL,
tp_fz NUMERIC(18,0) NULL);
alter table temp_c_s_y
add constraint pk_tp_sh primary key nonclustered (tp_sh) ;
declare @i NUMERIC(18,0) /////建变量i
declare @f NUMERIC(18,0) /////建变量f
set @i=0 //////
set @f=1
while @i<12
begin
if @i>=0 then
insert into temp_c_s_y
select tp_sh,tp_fz
from temp_c_s_y
set @i=@i+1 //////
set @f=@f+1
else
end if
end
select * from temp_c_s_y ;