CREATE DATABASE (TSQL Statement)
creates a new database.
Syntax
CREATE DATABASE database_name
Arguments
- database_name
- is the name of the database to create.
Remarks
Only sa is allowed to execute this statement.
This statement does the following:
- creates some entries in the master dictionary
- creates a directory under the
data
subdirectory in the base path of the instance - creates a directory under the
index
subdirectory in the base path of the instance - creates a user dbo, with sa as the underlying login.
The command SHOW D
displays the list of all databases.
Examples
CREATE DATABASE mydb;