How to Create database in SQL Server

How to create database in SQL Server:
1. Using Sql Server Management Studio
2. Using T-SQL Script

1. Using SQL Server Management Studio



2. Using T-SQL Script:

 USE [master]
GO
/****** Object: Database [Sales] ******/
CREATE DATABASE [Sales]
CONTAINMENT = NONE
ON  PRIMARY ( NAME = N'Sales', 
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER01\MSSQL\DATA\Sales.mdf' , 
SIZE = 2048KB , MAXSIZE =UNLIMITED, FILEGROWTH = 1024KB )

LOG ON ( NAME = N'SalesOrders_log',
 FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER01\MSSQL\DATA\Sales.ldf' , 
SIZE = 1024KB , MAXSIZE =2048MB , 
FILEGROWTH = 10%)
GO

Comments