We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,567 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

sql server db create command

In my project i want to create a database through my application, how can create new database using sql statement.( i.e create database...)

5
Contributors
9
Replies
1 Month
Discussion Span
2 Months Ago
Last Updated
21
Views
bnitishpai
Newbie Poster
15 posts since Aug 2012
Reputation Points: 0
Solved Threads: 1
Skill Endorsements: 0
Ancient Dragon
Achieved Level 70
Team Colleague
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68

Thanks, but I have more. How to set the filepath for that database?

bnitishpai
Newbie Poster
15 posts since Aug 2012
Reputation Points: 0
Solved Threads: 1
Skill Endorsements: 0

Can you be a bit clearer please @bnitishpai

Do you want to know how create a DB using a language like C# or Java in Visual Studios rather than straight in SQL Server Management Studios, if so what language are you using?

ChrisHunter
Posting Pro
566 posts since Feb 2011
Reputation Points: 104
Solved Threads: 51
Skill Endorsements: 13

Can you be a bit clearer please @bnitishpai

Do you want to know how create a DB using a language like C# or Java in Visual Studios rather than straight in SQL Server Management Studios, if so what language are you using?

ChrisHunter
Posting Pro
566 posts since Feb 2011
Reputation Points: 104
Solved Threads: 51
Skill Endorsements: 13

What database server are you using? Most of them don't let you change the path, it's established when the database server is installed. And after thinking about it I don't think you can create a new database via programming languages because the language has to have a connection to an existing database in order to run sql commands.

Ancient Dragon
Achieved Level 70
Team Colleague
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68

@Ancient Dragon, I think you're right about not being able to establish a DB through languages like C#, i tried it a while ago (I wanted to open and run an SQL file with a DB creation script in when a program is run for the first time) but there had to be a connection to a server already established before the script to create the DB could be run.

ChrisHunter
Posting Pro
566 posts since Feb 2011
Reputation Points: 104
Solved Threads: 51
Skill Endorsements: 13

If you have an sa account you can login to master db and create a new one.

adam_k
Veteran Poster
1,057 posts since Jun 2011
Reputation Points: 274
Solved Threads: 205
Skill Endorsements: 11

They can also be created using stored procedures, assuming you have the permissions to do that.

Ancient Dragon
Achieved Level 70
Team Colleague
32,109 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68

Hi Dear;
How to create database in sql server ;
Sql is the Structured querie Language ... & the queries command is......

create database databasename;

this is the database creation command ;
regards
prem

pssingh1001
Newbie Poster
14 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0856 seconds using 2.72MB