|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Informational Queries
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 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 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 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
Other interesting topics
Variable Number of Parameters
how to know if a DEFAULT exists or not Perfmon counters into SQL Server table Why use null values? how do I search for duplicate values in normalized data ? Query's in Query Analyzer sometimes extremely slow Q: full backup sqlservr.exe -g ??? SQL Enterprise Manager Question DATEPART with 2 digits |
|||||||||||||||||||||||