Is there a way to scan a SQL Server to find all the stored procedures, read in their bodies, and determine a list of tables they use? My purpose is to perform an analysis on a large legacy database. (SQL Server 2008R2, preferably C#, but language is largely immaterial.)
Share
Leverage SQL Server’s
sp_dependssystem stored procedure.sp_depends, and insert its results into a table.More on
sp_depends