Yes you can do this. From the command line run osql -S {servername} -E
That should connect you do the database server.
Then type this;
Code:
create database {databasename}
go
exit
That will create a database with whatever name you put in for {databasename}. Something to note, do not use spaces in the database name. SQL doesn't like it.
Denny
--Anything is possible. All it takes is a little research. (Me)
You can run any Transact SQL statement with OSQL. To see a list of command line parameters, get to the command prompt and type OSQL ?. If you have Books On Line (BOL), there is a good section about the osql utility.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.