Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1824
  • Last Modified:

Check if cursor is empty

What's a good way to check if the cursor is empty?
Can I just check a column name in the cursor if it's empty or there is another neat way of doint this?

MS Sql Server 2000
1 Solution
Scott PletcherSenior DBACommented:
Yes, you can reference @@CURSOR_ROWS after opening the cursor.  If it's zero, no rows were found.  Please see "Books Online" for other possible values of @@CURSOR_ROWS and their meanings (especially note that negative values are possible and have a special meaning).

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now