Solved

How to find out which reports use a specific stored procedure?

Posted on 2010-08-19
5
440 Views
Last Modified: 2012-05-10
Is there a way to find out which reports refer to a specific stored procedure, other than checking all reports individually?

This is to avoid the situation where a stored procedure is updated correctly for one report, but not realizing that the update breaks other reports that refer to the same stored procedure
0
Comment
Question by:mc_eze
  • 2
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
rajeshprasath earned 250 total points
ID: 33475486
you need to run a profiler and find out all the reports that using the same stored procedure.
0
 

Author Comment

by:mc_eze
ID: 33475903
Thanks for the tip
0
 
LVL 2

Expert Comment

by:rajeshprasath
ID: 33475986
open all the report rdl files in xml editor and then search the storedprocedure name in seach dialog by checking the all open documents option. you can use editpro or editplus for quickly find the reports.
0
 
LVL 10

Expert Comment

by:itcouple
ID: 33476324
Hi

If you want to automate it I suggest to look for some code (eg VBA/VBscript) to loop throught XML files in your solution folder and find the tags which store SP name.

Regards
Emil
0
 

Author Comment

by:mc_eze
ID: 35773191
This query turned out to be what was needed. This was found here: http://beyondrelational.com/blogs/jacob/archive/2008/01/16/how-to-find-all-stored-procedures-used-by-report-server.aspx

;WITH XMLNAMESPACES (
DEFAULT
'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition',
'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd

)
SELECT *
name,
x.value('CommandType[1]', 'VARCHAR(50)') AS CommandType,
x.value('CommandText[1]','VARCHAR(50)') AS CommandText

FROM (
select name,
CAST(CAST(content AS VARBINARY(MAX)) AS XML) AS reportXML
from ReportServer.dbo.Catalog

) a
CROSS APPLY reportXML.nodes('/Report/DataSets/DataSet/Query') r(x)
WHERE x.value('CommandType[1]', 'VARCHAR(50)') = 'StoredProcedure'
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question