Using the create database command

To use create database, you must have create database permission, and you must be a valid user of master. Always type use master before you create a new database. See the Reference Manual: Commands.

NoteEach time you enter the create database command, dump the master database. This makes recovery easier and safer in case master is later damaged. See Chapter 14, “Restoring the System Databases.”

You can create only one database at a time.

In its simplest form, create database creates a database on the default database devices listed in master..sysdevices:

create database newpubs

When a user with the required permission issues create database, Adaptive Server:

The new database initially contains a set of system tables with entries that describe the system tables themselves. It inherits all the changes you have made to the model database, including:

After creating a new database, the system administrator or database owner can use sp_adduser to manually add users to the database with sp_adduser. If you are adding new Adaptive Server logins, you may also need the system security officer. See Chapter 13, “Getting Started with Security Administration in Adaptive Server,” in the System Administration Guide: Volume 1.