Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Procedures using perticular table

Author  Topic 

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-02-27 : 06:49:07
How to find procedure names perticular table is being used inside the procedure..

Thanks in advance

Vabhav T

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-27 : 06:50:56
use sp_depends

http://msdn.microsoft.com/en-us/library/ms189487.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-02-27 : 07:06:04
No its not working because one table i have been used in many procedures.
and its showing msg 'Object does not reference any object, and no objects reference it'


Vabhav T
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-02-27 : 07:07:38
because sp_depends give only tables that are in relation with that table

Vabhav T
Go to Top of Page

Jaime
Starting Member

19 Posts

Posted - 2010-02-27 : 09:33:36
Prior to SQL 2008, sp_depends can be inaccurate due to deferred name resolution. Deferred name resolution occurs when you create a procedure that references an object before the other object exists. It can also happen when you drop and re-create the dependent object. I would recommed doing a text search on your source-control of the database schema, or a query of sys.sql_modules(syscomments before SQL 2005), in addition to sp_depends.
Go to Top of Page
   

- Advertisement -