declare @变量 nvarchar(50)
DECLARE Customer_cursor CURSOR
FOR select 变量 from 数据表
OPEN Customer_cursor
FETCH NEXT FROM Customer_cursor
INTO @变量
WHILE @@FETCH_STATUS = 0
Begin
print @变量
FETCH NEXT FROM Customer_cursor
INTO @变量
End
CLOSE Customer_cursor
DEALLOCATE Customer_cursor
DECLARE Customer_cursor CURSOR
FOR select 变量 from 数据表
OPEN Customer_cursor
FETCH NEXT FROM Customer_cursor
INTO @变量
WHILE @@FETCH_STATUS = 0
Begin
print @变量
FETCH NEXT FROM Customer_cursor
INTO @变量
End
CLOSE Customer_cursor
DEALLOCATE Customer_cursor