Create Database in Sql Server 2005, Database Statements

Following is the full syntax used for creating databaseexceed the MAXSIZE setting"
in Sql Server 2005.NOTE : Everything written between [ ] is optional .
CREATE DATABASE database_nameBut remeber that to create a database you must be a
[ ON [ PRIMARY ]  [ <  filespec >] ]member of the dbcreator server role.
{ LOG ON [ < filespec > ] ]After a database is created, to check details of the
< filespec > : : =database use following command :sp_helpdb [
( [ NAME = logical_file_name , ]database_name ]
FILENAME = 'os_file_name'To drop a user defined database use following
[ , SIZE = size ]command:
[ , MAXSIZE = { max_size | UNLIMITED } ]DROP DATABASE database_name
[ , FILEGROWTH = growth_increment ] ) [ ,.... n ]Note: you cannot delete a system-defined database.
Description ::-To rename a user-defined database use
ON specifies the disk file used to store the data:sp_renamedb old_database_name ,
portion of the database.new_database_name
LOG ON specifies the disk files used to store log files.Fortunately you can also create a database by a right
FILENAME=os_file_name specifies theclick on the object explorer, Thanks to SQL SERVER
operating-system file name for the file.Management studio 2005.
PRIMARY specifies the associated <filespec> listSQL SERVER 2005 contains the following system
that defines files in the primary filegroup.database :
NAME=logical_file_name specifies the logical name for
the file.1. master
MAXSIZE=max_size specifies the maxium size to2. tempdb
which the file defined in the <filespec> list can3. model
grow.4. msdb
FILEGROWTH=growth_increment specifies the5. Resource
growth increment of the file defined in theIf u have any query feel free to ask. If u like this post ,
<filespec> list.rate & comment it.
Remember - " FILEGROWTH setting for a file cannot