Counter of Festivals

Ashok Blog for SQL Learners and Beginners and Experts

Tuesday, 28 April 2015

CREATE DATABASE on Diffrent Drive in SQL Server and Move Database in Diffrent Drive

CREATE DATABASE on Diffrent Drive:


T-SQL:

CREATE DATABASE [TestSample] ON  PRIMARY
( NAME = N'TestSample', FILENAME = N'E:\TestSample.mdf' , SIZE = 5MB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON
( NAME = N'TestSample_log', FILENAME = N'F:\TestSample_log.ldf' , SIZE = 2MB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [TestSample] SET COMPATIBILITY_LEVEL = 100
GO