September 8, 2008 at 11:09 pm
Hi,
I have a table and i want to know sql query which will return all the views created on that table.
Thankd in advance.
September 9, 2008 at 5:53 am
Hi Ruchi,
The following stored procedure will help you in finding all the related views created on a given table.
Use ‘databasename’
sp_depends 'tablename'
This would provide the complete dependencies on the table(foreign key references, etc), however in this context we are interested only on views. Hence you need to check out for the type 'view'
Let me know if this helps...else we can look out for some other options.
-Rajini
September 9, 2008 at 6:10 am
Thanks a lot, this has solved my problem...
September 9, 2008 at 6:14 am
Hello,
For the record, it is worth noting that sp_depends only returns references to objects within the current DB i.e. if there are Views in other DBs based on the table, then they won't be reported.
Regards,
John Marsh
www.sql.lu
SQL Server Luxembourg User Group
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply