Thursday 17, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

Create Database in Sql Server 2005, Database Statements

Following is the full syntax used for creating database in Sql Server 2005.

-------------------------------------------------------------------------------------------------------------------------------------------


CREATE DATABASE database_name

[ ON [ PRIMARY ]  [ ] ]

{ LOG ON [ < filespec > ] ]

< filespec > : : =

( [ NAME = logical_file_name , ]

FILENAME = 'os_file_name'

[ , SIZE = size ]

[ , MAXSIZE = { max_size | UNLIMITED } ]

[ , FILEGROWTH = growth_increment ] ) [ ,.... n ]


Description ::-


ON specifies the disk file used to store the data portion of the database.


LOG ON specifies the disk files used to store log files.


FILENAME=os_file_name specifies the operating-system file name for the file.


PRIMARY specifies the associated list that defines files in the primary filegroup.


NAME=logical_file_name specifies the logical name for the file.


MAXSIZE=max_size specifies the maxium size to which the file defined in the list can grow.


FILEGROWTH=growth_increment specifies the growth increment of the file defined in the list.


Remember - " FILEGROWTH setting for a file cannot exceed the MAXSIZE setting"


NOTE : Everything written between [ ] is optional .


But remeber that to create a database you must be a member of the dbcreator server role.


After a database is created, to check details of the database use following command :

sp_helpdb [ database_name ]



To drop a user defined database use following command:

DROP DATABASE database_name



Note: you cannot delete a system-defined database.


To rename a user-defined database use :

sp_renamedb old_database_name , new_database_name



Fortunately you can also create a database by a right click on the object explorer, Thanks to SQL SERVER Management studio 2005.



SQL SERVER 2005 contains the following system database :



master
tempdb
model
msdb
Resource


--------------------------------------------------------------------------------------------------------------------------------------------




If u have any query feel free to ask. If u like this post , rate & comment it.



Regards,


Anuj Tripathi

 
     ARTICLE REVIEWS
No Reviews has been posted yet
 
     POST REVIEW
Full Name :
E-mail :  (will not publish)
Web Site :  (optional)
Review :
 
Security Code :
 
 
     RELATED ARTICLES
What is Database Synchronization
Data synchronization is an online service that gives you the ability to provide an update of information between multiple servers on the network, regardless of their geographic location. The synchronization process allows data to migrate to-date info...more »
   
Database Management System Types and their Characteristics
Database management has become important part of every company that has got data to be managed and handled. Server databases and desktop databases are two types of database management systems. The desktop one is concerned with single-user applica...more »
   
Data Warehouse And Its Applications In Agriculture
  DATA WAREHOUSE AND ITS APPLICATIONS IN AGRICULTURE K.P.Wagh                                                                               Dr. Satish R. Kolhe      Â...more »
   
Database-driven Software for the Small Business Owner
If you have a small business, database-driven software can help you operate more efficiently and effectively.  Regardless of what you sell or the services that you provide, there are dozens, if not hundreds of things that you must keep track of on a...more »
   
Database Driven Telemetric Monitors Promise Bright Future for Manufacturing
Database Driven Telemetric Monitors can introduce manufacturing companies to a new kind of innovation that incorporates current off-the-shelf software components that control GPS, RFID, telemetry systems and a host of additional database driven produ...more »
   
 
Article Categories
 
  Affiliate Programs Articles
Affiliate Programs Articles
  Audio Articles
Audio  Articles
  Blogging Articles
Blogging  Articles
  Computer Forensics Articles
Computer Forensics Articles
  Computer Games Articles
Computer Games Articles
  Data Recovery Articles
Data Recovery Articles
  Databases Articles
Databases Articles
  Domain Names Articles
Domain Names  Articles
  E Learning Articles
E Learning Articles
  ECommerce Articles
ECommerce  Articles
  Email Articles
Email  Articles
  File Types Articles
File Types Articles
  Forex Trading Articles
Forex Trading Articles
  Forums Articles
Forums  Articles
  Hardware Articles
Hardware Articles
  Information Technology Articles
Information Technology Articles
  Internet Marketing Articles
Internet Marketing  Articles
  Intra net Articles
Intra net Articles
  Laptops Articles
Laptops Articles
  Link Popularity Articles
Link Popularity  Articles
  Networks Articles
Networks Articles
  Newsletters Articles
Newsletters  Articles
  Operating Systems Articles
Operating Systems Articles
  Programming Articles
Programming Articles
  RSS Articles
RSS  Articles
  Security Articles
Security Articles
  SEM Articles
SEM  Articles
  SEO Articles
SEO Articles
  SMO Articles
SMO  Articles
  Software Articles
Software Articles
  Spam Articles
Spam  Articles
  Videos Articles
Videos  Articles
  Web Design Articles
Web Design  Articles
  Web Hosting Articles
Web Hosting  Articles
 
 
 
POPULAR E-BOOKS
 
Download Evaluating Java for Game Development  Ebook Evaluating Java for Game Development
   
Download Super Affiliate Strategies Ebook Super Affiliate Strategies
   
Download Marketing Secrets for the Ages  Ebook Marketing Secrets for the Ages
   
Download Blueprints for a successful presentation  Ebook Blueprints for a successful presentation
   
Download The Smart Marketers Resource Handbook Ebook The Smart Marketers Resource Handbook
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz