SQLCMD
SQLCMD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AnalogX SQLCMD allows you to quickly and easily run SQL queries against ODBC
data sources. Basically, it's a simple portable way to execute SQL commands
from batch files, etc.
SQLCMD is like most commandline utilities out there; from the command prompt
you can type the name by itself to get a list of options:
F:\tools\sqlcmd> sqlcmd
USER This is the username to login to the database with. This field
is optional and will try to log in using a NULL account when it
is not supplied.
PASS Password for username specified above.
DB ODBC Database to connect to.
LOG Specify the filename to log to. Useful for debugging or keeping
track of operations performed. While not a log in the normal
sense, it outputs all information pertaining to commands run.
APPEND Instead of overwriting the existing log file, it will append
onto it.
SILENT Suppresses all text output.
COMMAND SQL query to perform
or:
sqlcmd /user Jimmy /pass Password /db "Website" /command "update [users] set
Downloads=1"
without the /COMMAND then it will go into it's "interactive" mode, where you
can just enter in SQL queries. Once in this mode, simply type 'QUIT' and it
will exit.
If the program thinks it has successfully executed the command, it will return
0, otherwise it will return 1 (these are normally the defaults for success
and failure for commandline programs), so it should be easy to include SQL
commands into batch files.
For more info, and some MP3 music, make sure to check out our website at:
http://www.analogx.com/