CREATE <object type> <object name>
CREATE DATABASE <database name>
A more complete list of syntax: log files and database files are not placed on a disk, scramble for disk IO, and compromise security.
CREATE DATABASE <database name>
[On [PRIMARY]
([NAME = < ' logical file NAME ';,]
FILENAME = < ' file name ' >
[, SIZE = <size in Kilobytes,megabytes,gigabytes,or terabytes>]
[, MAXSIZE = <size in Kilobytes,megabytes,gigabytes,or terabytes>]
[, filegrowth = <kilobytes,megabytes,gigabytes,or terabytes|percentage>]]
[LOG on
([NAME = < ' logical file NAME ';,]
FILENAME = < ' file name ' >
[, SIZE = <size in Kilobytes,megabytes,gigabytes,or terabytes>]
[, MAXSIZE = <size in Kilobytes,megabytes,gigabytes,or terabytes>]
[, filegrowth = <kilobytes,megabytes,gigabytes,or terabytes|percentage>]]
[Containment = off| PARTIAL]
[COLLATE <collation Name>]
[For ATTACH [with <service Broker>] | For Attch_rebuild_log | With Db_chaining on| Off| Trustworthy on| OFF]----need to practice
[As SNAPSHOT of <source database Name>]
[;]
Actual combat:
CREATE DATABASE Accounting
On
(
NAME = ' Accounting ',
FILENAME = ' D:\AccountingData.mdf ',
SIZE = 10,
MAXSIZE = 50,
FileGrowth = 5
)
LOG on
(
NAME = ' Accountinglog ',
FILENAME = ' D:\AccountingLog.ldf ',
SIZE = 5MB,
MAXSIZE = 25MB,
FileGrowth = 5MB
)
Sp_help
sp_helpdb
sp_helpdb ' dbname '
SQL SERVER 2012 Chapter fifth Creating and modifying a data table のcreate statement