Skip to content
MS SQL Server command line querying, with Emacs sql-mode in mind.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Drop in replacement for sqlcmd that works better with sql-mode in Emacs. It only implements a subset of the options in sqlcmd, but more than enough for SQLi buffers.

The source file can be compiled with PyInstaller. Uses f-strings, so it requires Python 3.6.


Let's pretend the docopt help is good enough that I can use it here as documentation :)

Usage: [-h | --help] -S <server> -d <database>
                     [--driver <odbc_driver>]
                     (-E | -U <user> -P <password>)

Small command line utility to query MSSQL databases. The required parameters
are named to match the official tool, "sqlcmd".

Required arguments:
  -S <server>       Server name. Optionaly you can specify a port with the
                    format <servername,port>
  -d <database>     Database to open

And then either...
  -E                Use Integrated Security
  -U <user>         SQL Login user
  -P <password>     SQL Login password

Optional arguments:
  --driver <driver> SQL Server ODBC driver name, defaults to {SQL Server}

-S, -d, -E and -U & -P work just like their sqlcmd counterparts. That means most tools that interact with sqlcmd should be able to use sqlcmdline with no changes to the parameter list.

Coming soon: read password from environment variable or prompt for it, just like sqlcmd does.


Sebastián Monía -

Hodge -

Kevin Brubeck Unhammer -

You can’t perform that action at this time.