List of Databases on an Instance of SQL Server

To find how many databases in SQL Server.

There are ways to identify databases in any version SQL Server.

Solution 1:

Using SQL Server Management Studio.

Connect any instance of SQL Server Engine and expand the Object Explorer ->Databases.

Here we can see all user created databases.


Solution 2:

Using Transact-SQL.

Connect to the SQL Server Engine. Select New Query option from standard bar.

  1. List of all databases and its column properties of in an Instance:

           select  *  from sys.sysdatabases.

db_list2


2. Select specific columns of all databases in an instance.

          select name,dbid,cmptlevel from sys.sysdatabases.

db_list1

In this case we can list out database name, database id, compatibility  of all databases in an instance.

 

 

 

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s