Home » Categories » CHARTrunner

CR: SQL Server Stored Procedures Returns No Records

Revision Date: 2005-09-19


In some cases when using a SQL Server stored procedure to fetch data for a chart no data is returned and an error message is displayed, or the program appears to “hang”.

Several different error messages may be returned depending upon the version of CHARTrunner.  Some customers have reported that CHARTrunner appears to “hang” when the chart is drawn.  Starting in version 1.6.49 the error message says “The stored procedure did not return any records”.


This situation can occur if the stored procedure contains one or more action (e.g. INSERT, DELETE, UPDATE) or SELECT statements prior to the final SELECT statement that actually returns the records for the chart.  In this case the solution is to use SET NOCOUNT ON at the top of the stored procedure.

Apparently with SET NOCOUNT OFF (the default) SQL Server sends a "number of rows affected" message to the ADO provider for each action statement or SELECT statement in the stored procedure.  This confuses the ADO provider and results in the error condition.

Using SET NOCOUNT ON tells SQL Server not to send these "number of rows affected" messages and thus ADO doesn't get confused.

Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
CR: CR1.5 - My control chart data lines are not printing
Viewed 2152 times since Fri, Nov 9, 2007
CR: Error “External table is not in the expected format” using Excel 2007 workbook
Viewed 3952 times since Wed, Oct 14, 2009
CR: Show every date on the chart
Viewed 2189 times since Thu, Jan 31, 2008
CR: Chart [the name of the chart] failed with one or more errors
Viewed 2032 times since Fri, Nov 9, 2007
CR: Making a chart transportable
Viewed 2072 times since Fri, Nov 9, 2007
CR: Why is my first row of data not included when I get my chart from Excel
Viewed 2076 times since Fri, Nov 9, 2007
CR: Charting pass-fail data as a p-chart
Viewed 4354 times since Fri, Feb 29, 2008
CR: Some Excel Spreadsheet Values Seem To Be Missing
Viewed 2174 times since Fri, Nov 9, 2007
CR: CHARTrunner and Open Office
Viewed 2337 times since Fri, Nov 9, 2007
CR: Collating sequence not supported
Viewed 2570 times since Tue, Dec 11, 2007