Thursday, 21 June 2018

How to find out tables used in the specific stored procedure

;WITH stored_procedures AS (
SELECT AS proc_name, AS table_name,
ROW_NUMBER() OVER(partition by, ORDER BY, AS row
FROM sysdepends d
INNER JOIN sysobjects o ON
INNER JOIN sysobjects oo ON
WHERE o.xtype = 'P')
SELECT proc_name, table_name FROM stored_procedures
WHERE row = 1 and proc_name='input_stored_procedure name'
ORDER BY proc_name,table_name   

No comments:

Post a Comment

CPU queries in SQL server

-- Database Wise CPU Utilization report -- CPU_Time(Ms): CPU Time in Milliseconds -- CPUPercent: Let’s say this instance is using 50% CP...