Home > DeveloperSection > Interviews > How to get a list all databases?

Posted on    November-09-2010 12:00 AM

 MSSQL Server MSSQL Server 
Ratings:
 1 Answer(s)
  932  View(s)
Rate this:

Amit Singh

Total Post:565

Points:2825
Posted on    November-09-2010 1:00 AM

we get a list of all databases on the server by query the "sys.databases"

for example

SELECT name, database_id FROM sys.databases

Don't want to miss updates? Please click the below button!

Follow MindStick