Sunday, July 10, 2011

Find Which Stored Procedures are using a column in SQL Server

Use below query to find out which stored procedures are using a particular column in SQL Server.

SELECT
OBJECT_NAME(id)
FROM syscomments WHERE [text]
LIKE '%ColumnName%' AND OBJECTPROPERTY(id, 'IsProcedure') = 1
GROUP BY OBJECT_NAME(id)

No comments:

Post a Comment