Creates a database with explicit specifications for database and transaction log files. : Create Database « Database « SQL Server / T-SQL Tutorial






6> CREATE DATABASE projects
7>       ON (NAME=projects_dat,
8>         FILENAME = 'C:\DATA\projects.mdf',
9>         SIZE = 10,
10>         MAXSIZE = 100,
11>         FILEGROWTH = 5)
12>       LOG ON
13>       (NAME=projects_log,
14>         FILENAME = 'C:\DATA\projects.ldf',
15>         SIZE = 40,
16>         MAXSIZE = 100,
17>         FILEGROWTH = 10)
18>
19> drop database projects;
20> GO








19.1.Create Database
19.1.1.Creation of a Database
19.1.2.A CREATE DATABASE Example
19.1.3.create and drop database
19.1.4.If a database exists
19.1.5.A statement that attaches an existing database file
19.1.6.Create a database by specifying the mdf file
19.1.7.Create a database by indicating the mdf file
19.1.8.Attach a mdf file to database
19.1.9.Creates a database with explicit specifications for database and transaction log files.