Solved

Cursor add condition

Posted on 2012-03-13
2
388 Views
Last Modified: 2012-03-13
Yes I want to add a condition to my cursor if a row returns blank skip and show the rows that are not blank.  

OPEN tblcur
FETCH NEXT FROM tblcur INTO @tbl
WHILE @@FETCH_STATUS = 0
   BEGIN
EXEC GetInvoice @tbl, @Customer
 FETCH NEXT FROM tblcur INTO @tbl
END
close tblcur
0
Comment
Question by:Seven price
[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
2 Comments
 
LVL 25

Accepted Solution

by:
jogos earned 500 total points
ID: 37715875
<<Yes I want to add a condition to my cursor if a row returns blank skip and show the rows that are not blank. >>
The definition of the cursor is not here.  

Do you mean when the EXEC GetInvoice returns blank?  Then you must show definition of the stored proc GetInvoice and define what/how you want to 'show' the rows of what table.
0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 37716275
use if exists
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

628 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