Creating a Database using Transact SQL statement

Posted by Muhsinathk under Sql Server on 6/13/2012 | Points: 10 | Views : 1586 | Status : [Member] | Replies : 5
Hi,

I want SQL query for creating a Database using Transact SQL statement..




Responses

Posted by: Shoyebaziz123 on: 6/13/2012 [Member] Starter | Points: 25

Up
0
Down
create database ABC

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 6/13/2012 [Member] Silver | Points: 25

Up
0
Down
The CREATE DATABASE statement is used to create a database.
The simple syntax is
CREATE DATABASE database_name


For detailed Example and explanation,please refer MSDN
http://msdn.microsoft.com/en-us/library/ms176061%28v=sql.105%29.aspx

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravianand on: 6/14/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Create Database Abc(database_name)

Regards,
Ravi

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 6/14/2012 [Member] Bronze | Points: 25

Up
0
Down
I got the answer..

Use this query

CREATE DATABASE db_name
[ON[PRIMARY]{file_spec1},...]
[LOG ON {file_spec2},...]
[COLLATE collation_name]
[FOR{ATTACH| ATTACH_REBUILD_LOG}]

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 6/21/2012 [Member] Starter | Points: 25

Up
0
Down
CREATE DATABASE <DATABASE_NAME>

EXAMPLE:

CREATE DATABASE TEST


REGARDS

SRIRAM.R

sriram

Muhsinathk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response