:::: MENU ::::

Get count of the number of rows in the cursor

  • Jan 07 / 2010
  • 0
Cursors, dbDigger, T-SQL Interview Questions

Get count of the number of rows in the cursor

Question:

If you open a cursor, which of these will allow you to get a count of the number of rows in the cursor? (select all that apply)

Answer:

  • sp_cursor_list
  • sp_decribe_cursor
  • sp_describe_cursor_columns
  • @@cursor_rows

Explanation: All of these items will allow you to determine the number of rows in some cursors, subject to restrictions. The @@Cursor_rows requires a non-dynamic cursor and the sp_describe_cursor_columns requires you to count the number of rows returned.

The question of day is taken from SqlServerCentral.com. I want to compile selected QOD to share.

Consult us to explore the Databases. Contact us