Icon CREATE DATABASE

Creates a new database.

Syntax
CREATE DATABASE <Name>
PATH <Path>|IN MEMORY
[ENCRYPTED CATALOG|UNENCRYPTED CATALOG]
[DESCRIPTION <Description>]
[ATTRIBUTES <CustomAttributes>]

<Path> = Any valid operating system path

Usage
Use this statement to create a new database. If the path specified for the database is not valid, then ElevateDB will attempt to create the path. Specifying the IN MEMORY keywords instead of a path will result in the database being created in memory.

Information As of 2.03 Build 14, if you specify a relative path for an on-disk (not in-memory) database, the relative path will be interpreted as relative to the current configuration file path setting for the current session. For example, given a configuration file path of 'C:\MyApplication', the database path 'MyDatabase' will be interpreted as 'C:\MyApplication\MyDatabase'.

The ENCRYPTED CATALOG clause can be used to indicate that the catalog for the database should be encrypted on disk.

Information Using the UNENCRYPTED CATALOG clause is the same as not specifying the ENCRYPTED CATALOG clause, and is present for compatibility with the CREATE DATABASE syntax.

Examples
-- The following statement creates a Support database using a
-- path name without a drive letter.

CREATE DATABASE "Support"
PATH '\support\data'
DESCRIPTION 'Support Database'

-- The following statement creates an Accounting database using a
-- path name with a drive letter.

CREATE DATABASE "Accounting"
PATH 'g:\acctng\data'
DESCRIPTION 'Accounting Database'

-- The following statement creates an Accounting database using a
-- relative path name.  The database will be located in the 'data'
-- subdirectory under the defined configuration path.

CREATE DATABASE "Accounting"
PATH 'data'
DESCRIPTION 'Accounting Database'

-- The following statement creates an Accounting database using a
-- relative path name.  The database will be located in the same
-- directory as the defined configuration path

CREATE DATABASE "Accounting"
PATH '.'
DESCRIPTION 'Accounting Database'

-- The following statement creates a Tracks database in memory

CREATE DATABASE "Tracks"
IN MEMORY
DESCRIPTION 'Song Tracks Database'

Required Privileges
The current user must be granted the system-defined Administrators role in order to execute this statement. Please see the User Security topic for more information.

SQL 2003 Standard Deviations
This statement deviates from the SQL 2003 standard in the following ways:

DeviationDetails
ExtensionThis SQL statement is an ElevateDB extension.
Image