How to find the specific SQL query used in Any SSRS reports
Hi, How to find the specific SQL query used in across SSRS reports. Example: Select location in ('LONDON','NEWYORK',PARIS') Need to find reports used that above SQL query Thanks, Sweet
August 3rd, 2011 10:30am

If you have access to all of the RDL files, you could search them all for the <CommandText> element and return what is inside. <CommandText> will contain each dataset's query. If you want to get fancier you could parse the XML of the RDL file and retrieve even more information on each Dataset (e.g., parameters, fields returned). If you have PowerShell installed you can use the following script to return the file name and the first line of the command text for each *.RDL file in the current directory. I could not work out how to return all lines within the CommandText element without resorting to a full powershell script. I'm hoping this is useful enough for you... gci *.rdl | select-string "<CommandText>(.*)" | select FileName, Line -Rich
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2011 10:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics