Solved

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

Posted on 2010-08-19
5
462 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

688 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