Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursors in SQL Server

Status
Not open for further replies.

Saumya

Programmer
Dec 15, 2003
1
IN
Hi,
I am using cursors in SQL server.it is running but its returning each row one by one,how do i make it return a batch of rows???
thankx in advance.
 
Hiya,

To return multiple rows through a cursor, you need to use the command:

SET CURSOR ROWS number FOR cursor_name

For example, using a cursor get_name, if you want to get 10 rows each time, you would use:

SET CURSOR ROWS 10 FOR get_name

HTH

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top