- Before You Begin
- Using SQL Server Management Studio Using SQL Server Management Studio
- Using Transact-SQL Using Transact-SQL
- See also: See Also
APPLICATION AREA: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse
This topic describes how to view a list of databases in a SQL Server instance of SQL Server using SQL Server Management Studio SQL Server Management Studio or Transact-SQL Transact-SQL. SQL Server SQL Server SQL Server Management Studio or Transact-SQL Transact-SQL.
In This Section In This Topic
Before You Begin
Security
Permissions Permissions
If the principal invoking the sys.databases catalog view does not own the database and the database is not a master or tempdb database, the minimum necessary permissions to view the corresponding row are ALTER ANY DATABASE or VIEW ANY DATABASE server level permissions, or CREATE DATABASE permission in the master database. If you are a caller, you must be able to see the corresponding row and you will be able to do this. the master database. You can view the database to which the participant is connected, in the catalog view sys.databases . It can be viewed in sys.databases .
Using SQL Server Management Studio Using SQL Server Management Studio
View a list of databases in a SQL Server instance To view a list of databases on an instance of SQL Server
In Object Explorer, connect to the instance of the SQL Server Database Engine component of the SQL Server Database Engine and deploy it. In the Object Explorer , connect the SQL Server Database Engine to the SQL Server Database Engine, and then expand to the instance.
To view a list of all databases in an instance, expand the Databases list. To view a list of all databases, expand databases .
Using Transact-SQL Using Transact-SQL
View a list of databases in a SQL Server instance To view a list of databases on an instance of SQL Server
Connect to the Database Engine component of the Database Engine. Connect to the Database Engine Database Engine.
On the Standard panel, click Create Query . From the Standard bar, click New Query .
Copy the following example into the query window and click the Run button. Copy Execute . This example returns a list of databases hosted in an instance of SQL Server SQL Server. This example returns a list of SQL Server SQL Server. The list contains database names, their identifiers and creation dates. The list was created.
USE AdventureWorks2012; GO SELECT name, database_id, create_date FROM sys.databases; GO
See also: See Also
Database and file directory views (Transact-SQL) Databases and Files Catalog Views (Transact-SQL)
sys.databases (Transact-SQL) sys.databases (Transact-SQL)