sp_depends SP

  • sp_depends is giving perfect result.For example

    I created PRC2 SP.

    CREATE PROC PRC2 AS

    BEGIN

    Print 'PROC2'

    END

    PRC2 SP is used in PRC1

    CREATE PROC PRC1 AS

    BEGIN

    exec PRC2

    Print 'PROC1'

    END

    When i execute SP_Depends PRC1 it is displaying PRC2 as depends.This is right.

    when i drop and Create PRC2

    DROP PROC PRC2

    When i execute SP_Depends PRC1 it is not displaying depends.

    Please can you tell me how to find depends.

  • Unfortunately because the way that SQL Server tracks dependencies sp_depends and the sysdepends table are not always accurate. Mainly because of situations like you describe, and also because SQL Server uses deferred name resolution so you can reference an object that does not exist because SQL Server assumes you are going to create it.

    sysdepends uses the object id to track dependencies and when you drop and recreate an object the object_id changes.

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

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