Showing posts with label Create Database. Show all posts
Showing posts with label Create Database. Show all posts

Tuesday, 8 September 2015

How to create a database in Management studio ?

STEP 1 : 

Right click the database and select New Database option to create a new database in management studio.Refer the screenshot below.



STEP 2 : 

In the New database window ,enter the database name in text-box.I have created a database name as Sample.You can see the logical name created in the name of database such as sample and sample_log.Refer the screenshot below.


Here Logical name Sample is MasterDataFile and Sample_Log is LogDataFile.
The logical name can be changed by the user.
The default path is C drive(i.e Sql server installed path) highlighted in above screenshot.

STEP 3 : 

The default path can be changed to store the master data file and Log data file.Refer the screenshot below.


Here I have changed my file path to E drive.(Highlighted in Red colour)

STEP 4 : 

Now You can see the data files created at the mentioned path in the step 3.



STEP 5 : 

Finally you can see the Sample database created in the below screenshot.





Monday, 7 September 2015

How to Create a Database in a Simply Manner ?


Syntax : 
Create Database [Database Name]

Eg : Create Database Sample

Now the database will be created with the name of Sample.
And the two files will be created automatically (i.e) ldf and mdf.

mdf - Master Data File
ldf - Log Data File

These two files will be located in SQL server installed location(i,e default location)
Unless you specified the path