Creates a user-defined database. For examples, see Examples.
CREATE DATABASE database_name;
The name of the database to be created. Database names must be unique within an instance of MDB.
MANAGEMENT permissions required on the master database.
MANAGEMENT permissions default to members of the admin fixed database role. Members of the admin fixed database role can transfer permissions to logins and users.
The master database should be backed up whenever a user-defined database is created.
CREATE DATABASEcommand must be run in autocommit mode and can't be rolled back.
MDB implements the
CREATE DATABASE statement by using the following steps:
- MDB creates the database objects and stores it's specified configuration in the master database.
- A unique ID is assigned to the database.
- The master login that created the database assumes ownership of the new database and inherits
CONTROLover the database.
Creating a new database.
The following example creates a user-defined database called
financials. The master login assumes ownership of the new database
CREATE DATABASE financials;