Cursors for SQL server2008

Source: Internet
Author: User
Cursors in SQL server2008 include the cursor result set and cursor position, which is the set of rows returned by the definition SELECT statement, the cursor position
is a pointer to a row of this result set
To declare a cursor before using the cursor, define the properties of the Transact-SQL Server, for example, the cursor's scrolling behavior is used to generate the result of the cursor operation
Set of Queries
For example, define a cursor for the Student information table in the Student Performance management system database
Declare Cursor1 Cursor
For SELECT *
From Student information
1. Open the cursor
Open Cursor1
2. Retrieving cursors
FETCH NEXT from Cursor1
While @ @FETCH_STATUS = 0;
Begin
FETCH NEXT from Cursor1
End
3. Close the cursor
Close Cursor1

Cursors for SQL server2008

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.