SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Check if a view is used in a SP
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

richardlaw
Yak Posting Veteran

United Kingdom
68 Posts

Posted - 11/20/2012 :  03:26:54  Show Profile  Visit richardlaw's Homepage  Reply with Quote
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

India
52317 Posts

Posted - 11/20/2012 :  03:36:55  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.45 seconds. Powered By: Snitz Forums 2000