Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: List all databases on all servers Date: Thu, 14 Feb 2013 23:26:25 +0100 Organization: Erland Sommarskog Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="e87282ec96c371b8272e2d14c79930f2"; logging-data="2117"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18C6wkwJUFZcVvwCiyLP4FO" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:sl5jVwJxEUDH45LPlfnjALHLhMw= Xref: csiph.com comp.databases.ms-sqlserver:1391 Cathy (Cathy@Nospam.com) writes: > I want to setup a Database and a T-SQL script that queries the network > for all SQL servers and instances and then puts their names into > TBL_SQLSERVERS. If you want to discover SQL servers in your organisation, T-SQL is definitely not the right tool for this. I would exepct that SMO has some support for this. In practice, that would mean a PowerShell script. > This is to be followed by another query which I already have that uses > TBL_SQLSERVERS to give me a complete listing of all databases, types of > backups and data file and log file locations to allow me to check and > standardise all of these. Once you are connected to a server, you can start to query it. But then again, why reinvent the wheel? Here is one tool that I believes some of what you are asking for: http://www.apexsql.com/sql_tools_doc.aspx It is also worth checking out tools from other vendors such as Idera, SqlSentry, Quest etc. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx