how to find dependency on stored procedure

  • Hi,

    Just want to know Is there any way we can find number of reports depend on one Stored procedure?

  • implied dependancies only, i'm afraid.

    you can search the ReportServer.dbo.catalog for specific strings; and ideally int eh <CommandText> of the xml itself, sicne that's the command that the datasource sues.

    this is what i just put together:

    WITH MyCTE

    AS

    (

    select convert(varchar(max),CONVERT(varbinary(max),Content))As StrContent,*

    from reportserver.dbo.Catalog

    )

    SELECT SUBSTRING(StrContent,p1.i,p2.i - p1.i) As MostOfCommandText,* FROM MyCTE

    CROSS APPLY(SELECT CHARINDEX('<CommandText>',StrContent) As i) p1

    CROSS APPLY(SELECT CHARINDEX('</CommandText>',StrContent) As i) p2

    WHERE SUBSTRING(StrContent,p1.i,p2.i - p1.i) LIKE '%MyProcedureName%'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

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