Sunday, March 25, 2012

Cursor for

Hi,

Declare wh_ctry_id CURSOR FOR

Is "cursor for" is a function or datatype or what is this?

Regards

Abdul

According to the MSDN documentation...

Microsoft SQL Server statements produce a complete result set, butthere are times when the results are best processed one row at a time.Opening a cursor on a result set allows processing the result set onerow at a time. You can assign a cursor to a variable or parameter withacursor data type.

... a cursor is sort of result set within SQL Server.

|||

To know about the Cursors, check out the links given below:

http://www.databasejournal.com/features/mssql/article.php/1439731

http://www.teratrax.com/articles/sql_server_cursor.html

http://www.sqlteam.com/article/cursors-an-overview

|||

Hello Abdul,

The CURSOR FOR declaration is part of T-SQL. See:http://msdn2.microsoft.com/en-us/library/aa258831(SQL.80).aspx

You can use a cursor for looping over a number of records to perform certain actions in a stored procedure.

Jeroen Molenaar.

No comments:

Post a Comment