Q

SQL Server query to import database names

Discover a query that will import all database names into your SQL Server.

I want to import all database names into my SQL Server using a query. How can I do this?
Use the following SQL Server query:

SQL Server 2000: SELECT * FROM master.dbo. sysdatabases
SQL Server 2005: SELECT * FROM master.sys.databases

This was first published in February 2008

Dig deeper on SQL Server Stored Procedures

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close