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 |
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) |
 |
|
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. |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-07-29 : 10:13:52
|
Select * from msdb.dbo.sysjobsSelect * from msdb.dbo.sysjobstepsSelect * from msdb.dbo.sysjobschedulesWho it's for SQL doesn't know, so you'll have to get that from other people in your organisation.--Gail ShawSQL Server MVP |
 |
|
newdba
Starting Member
30 Posts |
Posted - 2011-07-29 : 10:15:32
|
thank u is there something for the stored procedures also? |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-07-29 : 13:44:50
|
select * from sys.procedures--Gail ShawSQL Server MVP |
 |
|
newdba
Starting Member
30 Posts |
Posted - 2011-08-01 : 08:12:59
|
thank you. |
 |
|
|
|
|