[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2010-08-19
5
Medium Priority
?
479 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 1000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

650 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