• An alternative I recently discovered is to use sp_refreshsqlmodule, which updates the dependency and other metadata for a procedure, function, or view. The following generates EXEC statements:

    SELECT

    'EXEC sp_refreshsqlmodule N''' + s.[name] + '.' + o.name + ''';' AS [stmt]

    , s.[name] AS [schema_name]-- schema name

    , o.[name] AS [object_name]-- procedure, function, or view name

    , o.[type] AS [object_type]-- type (P, FN, IF, TF, or V)

    FROM sys.objects o

    INNER JOIN sys.schemas s ON o.[schema_id] = s.[schema_id]

    WHERE o.[type] IN ('FN','IF','TF','P','V')

    ORDER BY

    o.[type]

    , s.[name]

    , o.[name]

    Copy and paste the first column into the editor and execute them, or you could use a cursor instead of the copy/paste method. sp_refreshsqlmodule raises an error if the object is no longer valid (for example a view referencing a column that has been dropped from a table).

    After executing sp_refreshsqlmodule, you can then use sys.sql_dependencies and sp_depends.