SQL Trace on a specific report

  • 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?

  • 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!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply