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
 SQL Maintenance

Author  Topic 

wsilage
Yak Posting Veteran

82 Posts

Posted - 2014-09-24 : 08:15:58
I was wondering if there is a way to create some kind of query to pull all of the DB names, Store procedures that are associated with views/tables.

Thanks

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2014-09-24 : 11:40:14
These system tables hold the information that you seek:
DB Names - sys.databases
Stored Procedures - sys.objects (Type = 'P')
Dependencies - sys.sysdepends



Too often we enjoy the comfort of opinion without the discomfort of thought. - John F. Kennedy
Go to Top of Page

wsilage
Yak Posting Veteran

82 Posts

Posted - 2014-09-24 : 11:57:42
Thank you so much!
Go to Top of Page

wsilage
Yak Posting Veteran

82 Posts

Posted - 2014-09-24 : 12:10:07
Is there a unique field that I can join all the tables together?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-09-24 : 13:43:29
quote:
Originally posted by wsilage

Is there a unique field that I can join all the tables together?



You'll need to check BOL for each system object. Alternatively you can grab a copy of the ERD for the system objects. The last one I had was sent to me for free when I signed up for a newsletter or something from one of the big vendors, might have been SQL Sentry or Quest/Dell.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -