日期:2014-05-17 浏览次数:20544 次
Create #Temp
(
idtep int
nametep nvarchar(30)
gradetep numeric(4,2)
)
Declare @name nvarchar(30)
Declare @id int
Declare @grade numeric(4,2)
Declare my_cursor Cursor Scroll for
select * from R
open my_cursor
While @@fetch_status = 0
begin
select id,name,grade from R where sex = '额'
fetch next from my_cursro into @name,@id,@grade
end
close my_cursor
deallocate my_cursor
Create #Temp
(
idtep int
nametep nvarchar(30)
gradetep numeric(4,2)
)
Declare @name nvarchar(30)
Declare @id int
Declare @grade numeric(4,2)
Declare my_cursor Cursor Scroll for
select * from R
open my_cursor
While @@fetch_status = 0
begin
select id,name,grade from R where sex = '额'
fetch next from my_cursro into @name,@id,@grade
insert #Temp--这里
values(@id,@name,@grade)--这里
end
close my_cursor
deallocate my_cursor