sql的游标用法举例(Cursor)
sql的游标用法举例
DECLARE @Name varchar(40), @TrueName varchar(20) Declare authors_cursor Cursor For Select Name,TrueName From Account Open authors_cursor Fetch Next From authors_cursor INTO @Name, @TrueName While @@FETCH_STATUS = 0 Begin Print @TrueName+CONVERT(Varchar(10),@@FETCH_STATUS) Fetch Next From authors_cursor INTO @Name, @TrueName End Close authors_cursor Deallocate authors_cursor