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)
 How to know list ot stored procs using TABLE

Author  Topic 

vision.v1
Yak Posting Veteran

72 Posts

Posted - 2010-02-16 : 08:02:57
Hi,

I have one table 'TABLEONE'. I would like to know the list of stored procedures which are using this 'TABLEONE'

Is it possible to know the list of procedures in sql server 2005


Thanks in advance

Kristen
Test

22859 Posts

Posted - 2010-02-16 : 08:10:40
exec sp_depends 'TABLEONE'
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2010-02-16 : 08:35:31
Or alternatively, right click on the table and select view dependencies
Go to Top of Page

vision.v1
Yak Posting Veteran

72 Posts

Posted - 2010-02-24 : 05:22:51
quote:
Originally posted by Kristen

exec sp_depends 'TABLEONE'




sp_depends shows the objects which are present in the current database...its not showing the objects which are present in other databases

Thanks for reply
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-24 : 05:37:53
quote:
Originally posted by vision.v1

quote:
Originally posted by Kristen

exec sp_depends 'TABLEONE'




sp_depends shows the objects which are present in the current database...its not showing the objects which are present in other databases

Thanks for reply


Did other solution work?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-02-24 : 05:49:22
it will also not work....

Vabhav T
Go to Top of Page

vision.v1
Yak Posting Veteran

72 Posts

Posted - 2010-02-24 : 05:55:05
quote:
Originally posted by madhivanan

quote:
Originally posted by vision.v1

quote:
Originally posted by Kristen

exec sp_depends 'TABLEONE'




sp_depends shows the objects which are present in the current database...its not showing the objects which are present in other databases

Thanks for reply


Did other solution work?

Madhivanan

Failing to plan is Planning to fail



I didn't found solution...
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-02-24 : 06:28:18
Just give the below statement a try:

select distinct object_name(object_id) from sys.sql_dependencies where referenced_major_id in (object_id(<your table name>))

Example:
select distinct object_name(object_id) from sys.sql_dependencies where referenced_major_id in (object_id('prcs_ctrl'))

Regards,
Bohra
Go to Top of Page

vision.v1
Yak Posting Veteran

72 Posts

Posted - 2010-02-24 : 06:58:00
quote:
Originally posted by pk_bohra

Just give the below statement a try:

select distinct object_name(object_id) from sys.sql_dependencies where referenced_major_id in (object_id(<your table name>))

Example:
select distinct object_name(object_id) from sys.sql_dependencies where referenced_major_id in (object_id('prcs_ctrl'))

Regards,
Bohra



No Luck
Go to Top of Page
   

- Advertisement -