Create data base

To Create the database using a query
Create database DatabaseName


Whether, you create a database graphically using the designer or, using a query, the following 2 files gets generated.
.MDF file - Data File (Contains actual data)
.LDF file - Transaction Log file (Used to recover the database)


To alter a database, once it's created 
Alter database DatabaseName Modify Name = NewDatabaseName


Alternatively, you can also use system stored procedure
Execute sp_renameDB 'OldDatabaseName','NewDatabaseName'


To Delete or Drop a database
Drop Database DatabaseThatYouWantToDrop


Dropping a database, deletes the LDF and MDF files.

Comments

Popular posts from this blog

Prime Number Program in C#

Fibonacci Series in C#

Joins in SQL server