Retrieving the T_SQL that generates an SSRS report?

  • Hi

    I have a number of SQL Reports and I would like to extract or view the actual SQL that generates the report data? Is this possible?

    The reports were created using Report Builder 1.0

    Many thanks for any response

    Craig H

  • You should be able to view the query in the report properties.

    If not, run a trace and open up the report. If the trace includes the text for batches, the query will be in there. Are you familiar with using Profiler or server-side traces?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • GSquared (2/15/2010)


    You should be able to view the query in the report properties.

    If not, run a trace and open up the report. If the trace includes the text for batches, the query will be in there. Are you familiar with using Profiler or server-side traces?

    Seconding the motion by Gus - check the report properties or run a trace.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • we can still try doing this with the trace by placing

    a TEXTBOX and assigning the DATASET value to it.

    The Word LIE sits right in the middle of the word BELIEVE

  • There was an article here at SSC back in early Feb that presented a suite of diagnostic reports. A lot of great stuff was in there including the SQL for each report. (Only the SQL for the first data source in cases where a report has more than one.)

    <rummage rummage rummage>

    Here it is: check out Report Server Diagnostic Reports [/url] from Feb 4, 2010.

    [font="Arial"]Are you lost daddy? I asked tenderly.
    Shut up he explained.
    [/font]
    - Ring Lardner

Viewing 5 posts - 1 through 4 (of 4 total)

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