while @@fetch_status=0.sql

来自「在学习SQL Server过程中整理的T-SQL语句」· SQL 代码 · 共 14 行

SQL
14
字号
use test
declare @name char(20),@st_id char(4)
declare student_cursor cursor for
                       select sno,sname from XS
open student_cursor
fetch next from student_cursor into @st_id,@name
select @st_id,@name
while @@fetch_status=0
     begin
         fetch next from student_cursor into @st_id,@name
          select @st_id,@name
     end
close student_cursor
deallocate student_cursor

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?