Basically I ve read a couple of questions regarding this matter on StackOverflow and there have been a lot of different opinions regarding the right answer. Could someone give a definitive answer to this , at least when it comes to SQL Server 2008 and upwards?
Also the reason why I am asking is because I would like to input the name of a table or field (table column) which would result in listing all the stored procedures with a dependency on the value entered . How would I go about doing this? This is my code so far.
SELECT *
FROM sys.sql_dependencies d
INNER JOIN sys.objects o
ON d.object_id = o.object_id
INNER JOIN sys.objects p
ON d.referenced_major_id = p.object_id
WHERE o.type_desc='SQL_STORED_PROCEDURE' and o.name LIKE
'%%' AND p.name LIKE '%%';