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
 General SQL Server Forums
 New to SQL Server Programming
 list all procedures in database

Author  Topic 

tyh2003
Starting Member

3 Posts

Posted - 2010-09-01 : 04:29:31
i wanna to ask is it possible to list all procedures that used for insert/update/delete a particular table in a database?


thks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-09-01 : 05:20:01

exec sp_depends 'your_table'

Madhivanan

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

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2010-09-01 : 05:48:26
Note that if your procs have dynamic sql in them and it is inside the dynamic sql where the insert / update / delete happens then sp_depends won't show them.




Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-01 : 12:44:16
[code]select * from sys.sql_modules where definition like '% tablename %' and objectproperty(object_id,'IsProcedure')=1[/code]

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

Go to Top of Page
   

- Advertisement -