Creating a DB using SQLCMD...

lidds

Junior Contributor
Joined
Nov 9, 2004
Messages
210
I need some help and advise. I am trying to create a database in the background when installed. I have the SQL script and I think SQLCMD is the way to go. I have downloaded SQLCMD and installed it in the following directory:

C:\Program Files\Microsoft SQL Server\80\Tools\Binn

however when I double click on the file it appears and then disappear again. Even though I want to run my SQL script on a batch type process, is this the correct path for it to be installed? and also is this the best way to do my task. I do not really want to write a .exe to do this task when MS provide apps. to do it for me.

Thanks in advance

Simon
 
SQLCMD is a command line utility - if you run it from a command prompt then you will get to see it's output.

If you want to run a script then the syntax is something like
Code:
sqlcmd -S <server name> -i <script file name> -E 
or
sqlcmd -S <server name> -i <script file name> -u <user name> -p <password>
 
Back
Top