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.
| Author |
Topic |
|
jasraja
Starting Member
22 Posts |
Posted - 2007-03-01 : 11:16:39
|
| Hi All,I have an ad-hoc requirement of extracting Table Names from all the views in my database. I have 100 plus views in my database and each has an average of five tables upon which the view is built.Is there any system procedure or inbuilt function then takes a list of all the views in the database and fetches me back with the list of views and associated tables.Thanks in Advance!!!Jaspreet |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-03-01 : 11:26:18
|
Try thisselect distinct object_name(sysdepends.id) as [View] , object_name(depid) as [Table] from sysdependsinner join sysobjects on sysdepends.id = sysobjects.idwhere sysobjects.type = 'V'order by [View], [Table] |
 |
|
|
jasraja
Starting Member
22 Posts |
Posted - 2007-03-02 : 09:21:34
|
| Thanks Mate...You saved a lot of my time!!!!Thanks again :) |
 |
|
|
|
|
|