Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

NoRowsMessage Not Displaying Expand / Collapse
Author
Message
Posted Monday, April 8, 2013 11:10 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 8:37 AM
Points: 49, Visits: 218
I have a report that gets its data from a stored procedure.
I have the NoRowsMessage property set to display my custom message but I still see the 'Invalid attempt to read when no data present' message.
Is there something special you need to do when using stored procedures? I can get it to work from a simple query with no data...

Thanks for all suggestions.
Post #1439949
Posted Tuesday, April 9, 2013 8:45 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 9:09 AM
Points: 10,342, Visits: 13,352
I've never seen this error when using a stored procedure. I've never had an issue with the no rows message not being used when a stored procedure doesn't return data.

Does the report work when the stored procedure does return data?

Can you run a trace when you run the report with a parameter combination does not return data and see what is happening on the SQL Server?

What happens when you run the stored procedure directly with the parameter combination that doesn't return data?




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1440383
Posted Wednesday, April 10, 2013 8:10 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 8:37 AM
Points: 49, Visits: 218
I got it working.

The proc uses dynamic sql based on parameter values from the report. SQL gets stored in a variable and then that sql is executed.
I modified the dynamic sql to insert the data into a global temp table and return the result set from that table.
This works great.

Running it in SSMS without the temp table resulted in the 'Commad completed successfully' message.
Running it in SSMS with the temp table gives me column headers with no rows. I guess that's the only way the report can understand there is no data where essentially the 'Commad completed successfully' message constitutes data?

Not sure but it is working so...
Post #1440828
Posted Wednesday, April 10, 2013 8:16 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 9:09 AM
Points: 10,342, Visits: 13,352
Without seeing the code, it's hard to say what is really happening.

What are you doing to mitigate against the risk of SQL Injection in the dynamic SQL?




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1440832
Posted Wednesday, April 10, 2013 9:16 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 8:37 AM
Points: 49, Visits: 218
The parameters are drop down lists populated by 2 seperate datasets that the user cannot edit.
Post #1440876
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse