Example:
Create a database with the name EXAMPLE by providing File Name, File Path, Database size, log size etc.,
Query:
Note: Simple database creation query need not require all these parameters. If we don't provide the parameters , then SQL Server will create the database in a default path with default sizes for Database and log.
Create a database with the name EXAMPLE by providing File Name, File Path, Database size, log size etc.,
Query:
CREATE DATABASE EXAMPLE
ON PRIMARY
(
NAME = N'EXAMPLE',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\EXAMPLE.mdf' ,
SIZE = 1216KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
(
NAME = N'EXAMPLE_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\EXAMPLE_log.LDF' ,
SIZE = 504KB ,
MAXSIZE = 2048GB ,
FILEGROWTH = 10%)
Note: Simple database creation query need not require all these parameters. If we don't provide the parameters , then SQL Server will create the database in a default path with default sizes for Database and log.