July 2014
Intermediate to advanced
214 pages
4h 47m
English
You can use either Transact-SQL DDL statements or SQL Server Management Studio to create and modify databases. In the following subsections, we will discuss these options.
In this section, we will cover Transact-SQL DDL statements that are used to create, alter and modify SQL Server databases.
We use the CREATE DATABASE statement to create a new database on SQL Server. The general syntax for the CREATE DATABASE command is as follows:
CREATE DATABASE database_name [CONTAINMENT = {NONE | PARTIAL}] [ON [PRIMARY] [<filespec> [,...n] [,<filegroup> [,...n]] [LOG ON <filespec> [,...n]]] [COLLATE collation_name] [WITH ...