Check DB consistency after DROP COLUMN

I have a SQL Server 2005 DB in which a design change requires me to drop a column.

Is there a way of identifying all references in the DB including functions & stored procs's that reference this column? I understand there are 3rd party products that can do this but was wondering if there was something baked into SQL Server itself.

Thank you 

April 25th, 2015 6:51pm

try this..

SELECT OBJECT_NAME (referencing_id),referenced_database_name, 
       referenced_schema_name, referenced_entity_name
FROM sys.sql_expression_dependencies
WHERE OBJECT_NAME(d.referenced_id) = 'Customers' --table name
      AND OBJECT_DEFINITION (referencing_id)  LIKE '%Cstomer%'; --column name
refer : http://www.mssqltips.com/sqlservertip/2999/different-ways-to-find-sql-server-object-dependencies/

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f229cdce-18d3-4c2d-9039-89876ee3ae3d/detecting-column-dependency-columns-used-on-column-calculation-in-sql-server?forum=sqlgetstarted

Free Windows Admin Tool Kit Click here and download it now
April 25th, 2015 6:57pm

See T-SQL scripts at blog: How to list object dependencies?
April 25th, 2015 7:25pm

I found very useful Aaron's stored procedure

http://sqlblog.com/blogs/aaron_bertrand/archive/2011/10/06/a-handy-search-procedure.aspx

Free Windows Admin Tool Kit Click here and download it now
April 26th, 2015 2:30am

See

http://visakhm.blogspot.com/2012/03/advantages-of-using-syssqlmodules-view.html

April 26th, 2015 3:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics