all groups > sql server mseq > april 2004 >
You're in the

sql server mseq

group:

create db


create db shif
4/23/2004 10:45:12 PM
sql server mseq: Hi
How can i create and attach a database with out using
Re: create db Vishal Parkar
4/24/2004 7:32:53 PM
hi shif,

To create a database you can make use of t-sql command "create database". If
you want to create a database without using enterprise manager you will have
to use above command with the help of application tools like "query
analyzer" OR command line utility like osql.

A typical syntax of create database will look as follows.

CREATE DATABASE <database_name>
ON
( NAME = logical_file_name ,
FILENAME = 'os_file_name_path' ,
SIZE = size_of_file ,
MAXSIZE = max_size_of_file, --max size to which file can grow.
FILEGROWTH = growth_increment_of_file )
LOG ON
( NAME = logical_file_name,
FILENAME = 'os_file_name_path',
SIZE = size_of_file ,
MAXSIZE = max_size_of_file, --max size to which file can grow.
FILEGROWTH = growth_increment_of_file )
GO

If you want to attach a database with the existing data and log files. you
can make use of clause "FOR ATTACH" in create database command. OR you can
make use of system stored procedure sp_attach_db.

See more help on both of the above commands and its explaination in Books
online

--
Vishal Parkar
vgparkar@yahoo.co.in


AddThis Social Bookmark Button