调试过的程序
CREATE PROC TEST1
@A INT ,
@B INT
AS
DECLARE MYCUR SCROLL CURSOR FOR select * from YOURNAME
while @a <@b
begin
DECLARE @CON1 INT,
DECLARE @CON2 VARCHAR
fetch absolute @a from mycur INTO @CON1,@CON2
INSERT INTO WANG SELECT @CON1,@CON2
set @a=@a+1
end
close mycur
deallocate mycur
CREATE PROC TEST
@A INT
@B INT
AS
DECLARE MYCUR SCROLL CURSOR FOR select * from yourtablename
while @a <@b
begin
open mycur
fetch absolute @a from mycursor
set @a=@a+1
end
close mycur
deallocate mycur