+ ISNULL(QuoteName(referenced_schema_name) + '.', '') + ISNULL(QuoteName(referenced_database_name) + '.', '') ISNULL(QuoteName(referenced_server_name) + '.', '') + QuoteName(OBJECT_NAME(referencing_id)) AS ProblemObject, QuoteName(OBJECT_SCHEMA_NAME(referencing_id)) + '.' There's a comment on the Michael J Swart article by RaduSun which gives a solution that I can't yet break though! This is it, tweaked mildly for readability and my purposes, but credit to RaduSun for the logic. Rick V.'s solution here was better - the only false positives it gave were for cross-database references. The original Michael J Swart script produced a huge number of false positives for me, far too many to wade through. The two previous solutions here are interesting, but both failed on my test databases.
0 Comments
Leave a Reply. |