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
 Check if a view is used in a SP

Author  Topic 

richardlaw
Yak Posting Veteran

68 Posts

Posted - 2012-11-20 : 03:26:54
Hi

I've recently started using SP's, and quickly written quite a few. I now need to check if a view ('dbo.usp_Members' for example) is used in any of my SP's.

What's the best way to do this? Can I use Management Studio, or another software application? Or can it be coded?

Thanks as always

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-11-20 : 03:36:55
you can use sp_depends procedure like

EXEC sp_depends 'usp_members'

or query catalog view INFORMATION_SCHEMA.ROUTINES , sys.sql_modules like in below link

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

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

Go to Top of Page
   

- Advertisement -