How to create a SQL Server Database

 How to create a SQL Server Database


USE master
GO

CREATE DATABASE [Production2]
 CONTAINMENT = NONE
 ON    PRIMARY 
( NAME = N'Production2', 
FILENAME = N'E:\DataFiles\Production2.mdf' , --<< this must be in its own physical drive
SIZE = 5MB , --<< pre size the data file 5000 mb
FILEGROWTH = 1MB )    --<< pre size the log file 100 mb

 LOG ON 
( NAME = N'Production2_log', 
FILENAME = N'F:\LogFiles\Production2_log.ldf' , --<< this must be in its own physical drive
SIZE = 1MB , --<< pre size size of transaction log file 100 mb
FILEGROWTH = 1MB ) --<< pre size size auto growth to increase in increments of 5 mb
GO

sp_helpdb [Production2]


Comments