SQL Server 2014 Tutorial – List all the databases in SQL Server using Query

Published on April 8, 2016 by abundantcode

Filed under SQL Server

Last modified April 8, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 1 (1 votes)

This article have been viewed 1800 times

Problem Statement

You need to list all the databases that are present in the current SQL Server instance.


The list of all the databases from the SQL Server instance can be obtained from the sys.databases object as shown below.

1. Open SQL Management Studio and connect to the SQL Server instance with your login details.

2. Click the "New Query" button and enter the below query in the Query window and click on the "Execute" button. This will display the databases that exists on the server in the results tab.


Note that this displays all the databases that you created along with the “system databases”.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

1 Comment

  1. SQL Server 2014 Tutorial – Display System Databases in Object Explorer. | Abundant Code
    April 8, 2016 - 10:54 pm

Leave a Comment


You might be Interested in these Posts

How to use array Rank in C# ?

In C# , the Rank property of the array is is used to get the rank of the array. In simple terms , ra...

How to append an array to another in JavaScript ?

In JavaScript , you may want to append one array to another array(s) to combine their elements resul...

Building a ASP.NET Web API in Visual Studio 2015

This blog post will explain on how to create a Simple ASP.NET Web API using Microsoft Visual Studio ...