Creating and Maintaining Databases

 Creating a Database

To create a database determine the name of the database, its owner (the user who creates the database), its size, and the files and filegroups used to store it.

Before creating a database, consider that:

Three types of files are used to store a database:

When a database is created, all the files that comprise the database are filled with zeros to overwrite any existing data left on the disk by previously deleted files. Although this means that the files take longer to create, this action prevents the operating system from having to fill the files with zeros when data is written to the files for the first time during usual database operations. This improves the performance of day-to-day operations.

It is recommended that you specify a maximum size to which the file is permitted to grow. This prevents the file from growing, as data is added, until disk space is exhausted. To specify a maximum size for the file, use the MAXSIZE parameter of the CREATE DATABASE statement or the Restrict filegrowth (MB) option when using the  Properties dialog box in SQL Server Enterprise Manager to create the database.

After you create a database, it is recommended that you create a backup of the master database.

To create a database

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To create a database using the Create Database Wizard

Enterprise Manager

Enterprise Manager

See Also

Changing the Database Owner

Files and Filegroups

Using Identifiers

sp_helpfile

sp_helpfilegroup