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.
Each 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 13, “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:
Verifies that the database name specified is unique and follows the rules for identifiers.
Makes sure that the specified database device names are available.
Finds an unused identification number for the new database.
Assigns space to the database on the specified database devices and updates master..sysusages to reflect these assignments.
Inserts a row into sysdatabases.
Makes a copy of the model database in the new database space, thereby creating the new database’s system tables.
Clears all the remaining pages in the database device. If you are creating a database to load a database dump, for load skips page clearing, which is performed after the load completes.
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:
The addition of user names.
The addition of objects.
The database option settings. Originally, the options are set to off in model. If you want all of your databases to inherit particular options, use sp_dboption to change the options in the model database. See Chapter 2, “System and Optional Databases and mChapter 8, “Setting Database Options,” in the System Administration Guide: Volume 1.
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.