How to find column usage in stored procedure?
Sometimes you want to rename or delete a column from a table in MS SQL Server. How to find column name dependency usage in MS SQL Server? There is no clean way of doing this. In management studio you can right-click on the object and select “View Dependency”, but this would show only object dependency. So you need to write some T-SQL code in order to find a dependency. Let’s say we need to find the dependency of a Title column from the Article table.
SELECT DISTINCT so.name FROM sys.syscomments sc INNER JOIN sys.objects so on sc.id=so.object_id WHERE sc.text LIKE '%Title%'
Posted on May 8, 2011 by Viktar Karpach