0

Sorry, if this has been asked previously. In services on a client, I can see that MS SQL Server has the status "started". and on this machine I don't have Microsoft SQL SERVER Management Studio.

How can I create a new database?

Thank you!

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Dax
  • 438
  • 1
  • 8
  • 29
  • please have a look at [how-to-ask](http://stackoverflow.com/help/how-to-ask) – swe Jan 05 '17 at 13:41
  • You could always download SSMS Client Tools. Also, just because the service is started, doesn't mean you'll have privileges to create objects. – SS_DBA Jan 05 '17 at 13:47

4 Answers4

1

Please use sqlcmd utility and then create script to be executed.

To execute script: sqlcmd -i C:\create_script.sql

Db create scritp example:

CREATE DATABASE testDb
GO

More about the db create options: https://msdn.microsoft.com/en-us/library/ms176061.aspx

Juozas
  • 916
  • 10
  • 17
0

There are multiple possibilities.

You can install MSSQL-Studio on any other pc and connect to your server or you can connect via any sql-client tool and create a database per sql, see MSDN.

swe
  • 1,416
  • 16
  • 26
0

you can use SQLCMD which comes with SQLinstallation..

create a file with create database syntax and save it as .sql file

CREATE DATABASE dbname;

Then use SQLCMD..

sqlcmd -S <ComputerName>\<InstanceName> -i <MyScript.sql> -o out.txt
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
0

With the MSSQL queries below, you can create a database:

CREATE DATABASE testdb
GO

Then, you can show all the existed databases:

SELECT name FROM master.sys.databases
GO

master
tempdb
model
msdb
testdb

Then, you can drop(delete) a database:

DROP DATABASE testdb
GO
Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129