Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

SQL Trace on a specific report Expand / Collapse
Posted Tuesday, July 23, 2013 12:21 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Thursday, October 20, 2016 11:40 AM
Points: 626, Visits: 1,948
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?
Post #1476748
Posted Tuesday, July 23, 2013 1:50 PM



Group: General Forum Members
Last Login: Today @ 12:09 PM
Points: 14,557, Visits: 38,448
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)


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!
Post #1476778
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse