web 2.0

How to Use CREATE DATABASE Command

The command "CREATE DATABASE" can be used to create a database and files to store data. You can also express some of the parameters that define the characteristics of a database. For example you can declare a maximum size of the file. If you use a simple command is:
CREATE DATABASE database_name

without parameters, the database will be created with the same size with a database that was created by  SQL Server named Model. SQL Server implemented CREATE DATABASE command in two phases:
  1. SQL Server, copying the Model database for the initial database with meta data.
  2. Then, SQL Server fills the page blank except for page that contains internal data that declare how to use a place name in the database. 
All objects in the database Model will be copied into the new database. You can also add objects such as tables, views, stored procedures, data types, etc into the database Model, so every time you create a new database objects will be included.

Each of the settings of the database model will be included in the new database unless you use the FOR ATTACH. For example the Model database option select into / bulkcopy set to OFF. If you change the database option with the command ALTER DATABASE model, the setting will affect the new database will be created.

    1 comments:

    UX Designers Delhi said...

    Awesome work.Just wanted to drop a comment and say I am new to your blog and really like what I am reading.Thanks for the share

    Post a Comment