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!
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!
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
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
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