--利用游标循环插入数据
DECLARE dt CURSOR FOR --建立游标
SELECT s_id FROM Student
open dt
DECLARE @dd int
FETCH NEXT FROM dt INTO @dd
WHILE @@FETCH_STATUS = 0
BEGIN
insert into Student1 (S_FIRST_NAME,S_LAST_NAME,S_BIRTH_DATE,S_WEIGHT_KG,S_HEIGHT_M)
select S_FIRST_NAME,S_LAST_NAME,S_BIRTH_DATE,S_WEIGHT_KG,S_HEIGHT_M
FROM Student WHERE s_id = @dd
FETCH NEXT FROM dt INTO @dd
END
close dt
DEALLOCATE dt
DECLARE dt CURSOR FOR --建立游标
SELECT s_id FROM Student
open dt
DECLARE @dd int
FETCH NEXT FROM dt INTO @dd
WHILE @@FETCH_STATUS = 0
BEGIN
insert into Student1 (S_FIRST_NAME,S_LAST_NAME,S_BIRTH_DATE,S_WEIGHT_KG,S_HEIGHT_M)
select S_FIRST_NAME,S_LAST_NAME,S_BIRTH_DATE,S_WEIGHT_KG,S_HEIGHT_M
FROM Student WHERE s_id = @dd
FETCH NEXT FROM dt INTO @dd
END
close dt
DEALLOCATE dt