Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding out if a view is used

Status
Not open for further replies.

akki007

Programmer
May 22, 2003
55
0
0
GB
I have many many views and I would like to do some housekeeping. Is it possible to run a SP to find out if a view is in use by a stored procedure or another view etc?

Ta
 
You could script out all the Stored Procedures and Views to a text file and then edit the file(s). Do a simple FIND on the needed view name w/in the file and BINGO.

Thanks

J. Kusch
 
How about querying the syscomments table.

Try this:

Select * From syscomments
Where Text Like '%[Your view name]%'
 
Or sysdepends... though it won't help much if dynamic SQL is heavily used.

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top