Home All Groups Group Topic Archive Search About

Informational Queries



Author
9 May 2005 4:54 PM
John Jarrett
Hello,

Are there any commands that would give infomation on all DBs on a SQL
server?  (IE size, location of files, name, that sort of thing?)  I have just
been given about twenty SQLservers and due to a person leaving I am hoping to
find ot some information about what is on them 

I apprecitate the help.
--
jj

Author
9 May 2005 5:14 PM
mark baekdal
declare @dbname sysname

if object_id('tempdb..#dbs')is not null drop table #dbs
select
    [name]
into
    #dbs
from
    master..sysdatabases

while (select count(*) from #dbs)>0 begin
    select top 1 @dbname=[name] from #dbs
    exec ('sp_helpdb [' + @dbname + ']')
    delete #dbs where [name]=@dbname
end


regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server






Show quoteHide quote
"John Jarrett" wrote:

> Hello,
>
> Are there any commands that would give infomation on all DBs on a SQL
> server?  (IE size, location of files, name, that sort of thing?)  I have just
> been given about twenty SQLservers and due to a person leaving I am hoping to
> find ot some information about what is on them 
>
> I apprecitate the help.
> --
> jj
Are all your drivers up to date? click for free checkup

Author
9 May 2005 5:18 PM
Jens Süßmeyer
The system tables will provide you with the appropiate information, but.....
the best thing is to query them via the predefined stored procedures, read
about the sp_help% procedures in BOL, that´ll help you.

For example sp_helpdb, sp_helpfiles


HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---

Show quoteHide quote
"John Jarrett" <JohnJarr***@discussions.microsoft.com> schrieb im
Newsbeitrag news:11569D6F-1381-4E14-9F1E-C0EFB2ABA943@microsoft.com...
> Hello,
>
> Are there any commands that would give infomation on all DBs on a SQL
> server?  (IE size, location of files, name, that sort of thing?)  I have
> just
> been given about twenty SQLservers and due to a person leaving I am hoping
> to
> find ot some information about what is on them
>
> I apprecitate the help.
> --
> jj
Author
9 May 2005 5:22 PM
Alejandro Mesa
See sps sp_helpdb and sp_helpfile in BOL.


AMB

Show quoteHide quote
"John Jarrett" wrote:

> Hello,
>
> Are there any commands that would give infomation on all DBs on a SQL
> server?  (IE size, location of files, name, that sort of thing?)  I have just
> been given about twenty SQLservers and due to a person leaving I am hoping to
> find ot some information about what is on them 
>
> I apprecitate the help.
> --
> jj

Bookmark and Share