[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SSRS: Warning: Null value is eliminated by an aggregate or other SET operation

Posted on 2012-08-16
5
Medium Priority
?
2,469 Views
Last Modified: 2012-08-25
We have a SSRS Report that uses a SQL 2008 R2 stored procedure as its main dataset.  When we run the stored procedure from SSMS it runs without error.  When we run it from an SSRS report we get the error:

"An error has occurred during report processing. (rsProcessingAborted)
Query execution failed for dataset 'RoyaltiesACH'. (rsErrorExecutingCommand)
Arithmetic overflow error converting varchar to data type numeric. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation. Warning: Null value is eliminated by an aggregate or other SET operation."

It gives the same error if ran from Visual Studio in the Report Designer.  This report is rather old and just started producing this error.  Again when we run the SPROC by itself no problems, but when a report uses it it errors out.
0
Comment
Question by:Beratung
  • 2
  • 2
5 Comments
 
LVL 25

Expert Comment

by:TempDBA
ID: 38302638
Are you sure that you are running with the same parameters?
And add SET NoCount on to your procedure.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 38308683
This report is rather old and just started producing this error.  Again when we run the SPROC by itself no problems, but when a report uses it it errors out.
In SSMS, this is a warning message not an error.  If you do not want to have the warning message you have two choices:
1. Fix the data, by removing the NULLs that are causing it.
2. Fix the query by conditioning the columns that are causing it.

Pick your poison.
0
 

Accepted Solution

by:
Beratung earned 0 total points
ID: 38312842
This warning does not appear in SSMS.  It only appears in SSRS.  This seems to be a bug.  Somehow the execution plan or something is affected when you run this stored procedure within an SSRS report.  The reason this was hard to find the cause is because there is a filter in a where clause that filters out the row causing the problem.  When you run it in SSMS it seems the row that causes the error is not included when teh CAST and/or CONVERT is applied.  When you run it from SSRS the CAST/CONVERT is applied then the records are filtered.  In this case, we were CASTING a number into a VARCHAR (9).  All records in the data set were 9 digits.  There was a record that was filtered out that was 10 digits.  It was that one record that caused a problem when using SSRS but NOT when using SSMS to rund the SPROC.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 38312972
This warning does not appear in SSMS.  It only appears in SSRS.
Sure it does.  You are just not looking in the right place.  You are using the Grid mode and and not checking the Message tab.  Run it as Text and you will see it.

This seems to be a bug.
Nope.

When you run it in SSMS it seems the row that causes the error is not included when teh CAST and/or CONVERT is applied.
Correct that is why it is a Warning and not an Error.
0
 

Author Closing Comment

by:Beratung
ID: 38332117
This is a bug of some sort.  I other SQL Developers look at this code and the data and they agree it is behaving differently depending on how the stored procedure is run.  Running it in SSMS and SSRS, it behaves differently.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

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.
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

872 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