Inventarise SQL databases

RobaerC used Ask the Experts™
i've been asked to inventarise an unknown number of SQL2000 and SQL2005 databases, residing on an unknown number of Windows-servers. Does anyone know if there's a tool to investigate the servers and databases (without knowing the instances) ? The output has to contain instances/databasenames/owner/size/version etc. Can anyone help ?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This will get you the servers and versions... you'll need to incorporate some other code to return the list of dbs on the servers... but once you kow the server names this shouldn't be too difficult
After the above steps, just run the select * from Sys.databases command to get the names of databases.


Hi guys, thanks for your remarks.
What kind of userrights do I need to execute this script in a Windows network and get this information from a SQLserver? sa is no option
osql -E
will ensure you use windows authentication, not sql authentication.
So the account you are logged on as when running the script will need to have a login to the sql servers on the network. You will need access to the master database on each server in order to query what DBs are on the server. If you can use a "builtin/administrator" account then you should be ok. If not, just make sure your windows login has access to all the sql servers

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial