1.11M Members

sql server db create command

 
0
 

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

 
3
 
 
0
 

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

 
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?

 
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?

 
0
 

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.

 
0
 

@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.

 
0
 

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

 
0
 

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

 
0
 

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

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article