Le Kevin Blog Blog

0

To get list of tables used in a stored procedure

;WITH stored_procedures AS ( SELECT o.name AS proc_name, oo.name AS tables_used_in_procedure, ROW_NUMBER() OVER(partition BY o.name,oo.name ORDER BY o.name,oo.name) AS ROW FROM sysdepends d INNER JOIN sysobjects o ON o.id=d.id INNER JOIN sysobjects oo ON...