Extracting tables from SPs

  • GilaMonster (1/19/2016)


    dm_sql_referenced_entities is 2008 and above. sys.sql_dependencies can be inaccurate, as procedures can be created before the tables they reference, if they are the dependency info won't be there. No good solution on SQL 2005 and under short of writing a T-SQL parser or dropping and recreating all procedures and then checking sys.sql_dependencies.

    Good point. Would sp_refreshsqlmodule help here?

    -- Gianluca Sartori

  • Thank you for the information Gail

  • spaghettidba (1/19/2016)


    GilaMonster (1/19/2016)


    dm_sql_referenced_entities is 2008 and above. sys.sql_dependencies can be inaccurate, as procedures can be created before the tables they reference, if they are the dependency info won't be there. No good solution on SQL 2005 and under short of writing a T-SQL parser or dropping and recreating all procedures and then checking sys.sql_dependencies.

    Good point. Would sp_refreshsqlmodule help here?

    I don't think so. That's for when a table has been changed, to update the metadata for objects that use the table. Worth testing.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 16 through 17 (of 17 total)

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