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

SQL Trace on a specific report Expand / Collapse
Author
Message
Posted Tuesday, July 23, 2013 12:21 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, April 17, 2014 5:18 PM
Points: 504, Visits: 1,465
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


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:39 PM
Points: 12,749, Visits: 31,114
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1476778
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse