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 Administration
 databases on a server

Author  Topic 

newdba
Starting Member

30 Posts

Posted - 2011-07-29 : 09:47:40
is there a way to find out how many databases and which databases are on a server. after that i am going to be using the

SELECT * FROM INFORMATION_SCHEMA.tables

to get tables in the database

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-07-29 : 09:52:02
[code]select * from sys.databases[/code]Also, there is the undocumented feature sp_MSforeachdb http://weblogs.sqlteam.com/joew/archive/2008/08/27/60700.aspx
(I am scared of undocumented features, so I try to stay way from them if possible, but sometimes they are very useful)
Go to Top of Page

newdba
Starting Member

30 Posts

Posted - 2011-07-29 : 10:11:47
thank you that was perfect. i have one more question....how can i document the jobs running on the SQL servers. The job, what it does, when it runs, who it’s for, etc.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-07-29 : 10:13:52
Select * from msdb.dbo.sysjobs
Select * from msdb.dbo.sysjobsteps
Select * from msdb.dbo.sysjobschedules

Who it's for SQL doesn't know, so you'll have to get that from other people in your organisation.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

newdba
Starting Member

30 Posts

Posted - 2011-07-29 : 10:15:32
thank u is there something for the stored procedures also?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-07-29 : 13:44:50
select * from sys.procedures

--
Gail Shaw
SQL Server MVP
Go to Top of Page

newdba
Starting Member

30 Posts

Posted - 2011-08-01 : 08:12:59
thank you.
Go to Top of Page
   

- Advertisement -