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 stored procedure exists particular view

Author  Topic 

Vishal_sql
Posting Yak Master

102 Posts

Posted - 2012-06-28 : 01:53:05
Hi All,
I want to know how can we check whether particular view is used in which stored procedures.
eg: we have view name 'ABC' and if it is used in 3 different stored procedures P1,P2,P3. How can we know this through the query?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-06-28 : 02:24:08
This?
http://blog.sqlauthority.com/2007/09/03/sql-server-2005-search-stored-procedure-code-search-stored-procedure-text/


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Vishal_sql
Posting Yak Master

102 Posts

Posted - 2012-06-28 : 02:49:13
Hi,
I beleive this helped me , but the text column doesnt select complete view ( may be bcoz of limit of 4000 characters )

select so.name,so.type,sc.text from sysobjects so
inner join syscomments sc on so.id=sc.id
where so.type='P' and
sc.Text like '%[view name]%'

Go to Top of Page
   

- Advertisement -