Get list of databases from SQL Server

1.05K views
0

I have few SQL servers and I would like to export the database name list from each Microsoft SQL server. What is the easy way to get list of all databases from SQL server?

2

The best way to get list is as follow:

SELECT name
FROM master.dbo.sysdatabases

Once you get list, you can copy it. You may exclude default system databases like master, model, msdb ,testdb.

selected as best answer
Bloom Email Optin Plugin