SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Trace on a specific report


SQL Trace on a specific report

Author
Message
dan-572483
dan-572483
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3555 Visits: 2000
We have an SSRS Report on SQL Server 2008 R2 SP2 CU3 that is throwing a vague "500 Server error," but only when run against a specific customer record.

I ran a SQL trace filtered on the user's Client Process ID while the issue was reproduced, but did not find anything useful. But the SSRS log contains the folowing when the rport was run:

System.Data.SqlClient.SqlException: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.

I think it might be useful to run a SQL Trace on the Reporting Server PID instead. But the Reporting Server has about a dozen open processes connected to SQL at a given time.

What is the best way to run a SQL trace on specific report that will NOT create performance issues for other users?
Lowell
Lowell
SSC Guru
SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)SSC Guru (71K reputation)

Group: General Forum Members
Points: 71174 Visits: 40924
you should be able to fix it without a trace at all; the error is in the report itself.

somewhere in that' reports definition,you've got something like

...WHERE ClientID = (SELECT ID From AnotherTable)



for that one client, that table has more than one row, and causes the error.

grab the definition of the report, and find it.
simply changing it to an IN would fix it immediately.


...WHERE ClientID IN (SELECT ID From AnotherTable)



Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search