?
Solved

Check if cursor is empty

Posted on 2003-03-12
1
Medium Priority
?
1,700 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:nazzie303
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 200 total points
ID: 8123551
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).
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question