Tuesday, March 2, 2010

Finding the reference of tables in other tables and Stored procedures

some times we need to update a table/name and we want to know where this table is reffered in other database objects
so we can use following options to find
Option 1
SELECT DISTINCT so.nameFROM syscomments scINNER JOIN sysobjects so ON sc.id=so.idWHERE sc.TEXT LIKE '%tblsysacommunity%'
Option 2
SELECT DISTINCT o.name, o.xtypeFROM syscomments cINNER JOIN sysobjects o ON c.id=o.idWHERE c.TEXT LIKE '%tblsysacommunity%'

No comments:

Post a Comment