Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server query to find all current database names

Tags:

sql-server

I need a SQL query to find the names of existing databases.

like image 389
Bob Jones Avatar asked May 16 '09 21:05

Bob Jones


People also ask

What is the query to list all the databases?

To do that we will be using the below given commands: CREATE TABLE [database_name.] table_name ( pk_column data_type PRIMARY KEY, column_1 data_type NOT NULL, column_2 data_type, ..., table_constraints ); If we do not mention the name of the database then the default USE database is selected for the creation of tables.


1 Answers

Here is a query for showing all databases in one Sql engine

Select * from Sys.Databases 
like image 107
mmx Avatar answered Sep 21 '22 08:09

mmx