Wednesday, February 17, 2010

How to find what stored procedure uses a certain table?

Today I've found cool piece of code which lets you know what stored procedure uses some table. Just replace the name in a %Table Name%  and it gives you collection of stored procs which uses that table.

SELECT

Name
FROM
sys.procedures
WHERE
OBJECT_DEFINITION(OBJECT_ID) LIKE '%Table Name%'

Read more: Yonathan Masovich

Posted via email from jasper22's posterous