• 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