-
Access the Database Configuration Assistant using one of the following methods:
-
Windows: Launch Microsoft SQL Server Management Studio from Start menu.
-
Linux: no UI available. Either connect it from windows Microsoft SQL Server Management Studio or use sqlcmd for creating database.
-
Log in to Microsoft SQL Server Management Studio.
-
After successful login, press New Query, copy the SQL code below, and paste it into the new query window.
USE [master];
GO
CREATE DATABASE [<DATABASE_NAME>] ON PRIMARY ( NAME = N'<DATABASE_NAME>', FILENAME = N'<LOCATION>\<DATABASE_NAME>.mdf', SIZE = 1GB, FILEGROWTH = 10%)
LOG ON
(NAME = N'<DATABASE_NAME>_log', FILENAME = N'<LOCATION>\<DATABASE_NAME>_log.ldf', SIZE = 10MB , FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
ALTER DATABASE [<DATABASE_NAME>] SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE [<DATABASE_NAME>] SET ALLOW_SNAPSHOT_ISOLATION ON;
GO
Where:
<DATABASE_NAME> - Name of the database
<LOCATION> - Location where the database file is to be created
-
Click on Execute. Verify that the commands are executed
successfully and that the database is created.
|