Finding objects/dependencies in a large number of SQL scripts.
Hi All, How to get the name of objects used in a complex sql script.I don't want to use sp_depends.I have around 13k scripts. I need to automate the process to find the object names. Any suggestion will be helpful.
If you're in 2008 or higher version of SQL Server you can use [sy.dm_sql_referencing_entities] or sys.dm_sql_referenced_entities to run queries against your code to see where objects are being used. From an automation stand point, this is really about your only choice. You can query the system tables directly to just search for strings, but it won't show you accurate references. :