I need a T-SQL query to find a list of all database names and sizes from multiple SQL 2005 servers that are connected in a local network. Does one exist?
To access another server using T/SQL you would need to have linked servers setup to each of your SQL Servers.
Once you have the linked servers setup to access all the other servers run sp_helpdb remotely on each server. This will return the database name, size and other information about each database on the instance.
<pre>EXEC RemoteServer.master.dbo.sp_helpdb</pre>
Last Wiki Answer Submitted: March 18, 2009 9:01 pm by Denny Cherry64,520 pts.
All Answer Wiki Contributors: Denny Cherry64,520 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.