One instruction that works on three operating systems

mssql-cmd » Use cases » The same commands everywhere

Download mssql-cmd Free Trial »     Buy mssql-cmd Now »

The situation

Instructions travel badly between platforms. A procedure written against one operating system's database client has to be rewritten for another: different quoting, different environment variables, a different way of asking for a password, a different tool altogether. In a team where developers use macOS, CI runs on Linux and somebody's laptop is Windows, that is three sets of instructions to keep in step - and three places to get it wrong.

What you do

  1. Use one command syntax everywhere: mssql-cmd dsn="user:pass@host:1433/db" task=unload table=employees datafile=emp.csv quit=y.
  2. Write your runbooks, scripts and CI steps against that syntax. The same line works on Windows, Linux and macOS.
  3. Keep the same TUI experience too - connecting, browsing objects and editing SQL look and behave the same on every platform, so a screenshot in a ticket means the same thing to everyone.
  4. Move the file, not the knowledge: copy the binary to whichever machine needs it, and the instructions are already correct.

The same mssql-cmd interface on macOS

The screenshots on this site are the same tool on different systems, not different tools - see multiple platforms for the per-platform detail. Secure connections are supported on all of them, so the database's SSL and authentication requirements do not change the picture either.

What it will not do

Related

The mode: multiple platforms. Scripting: shell scripts, batch mode. Installing nothing: portable copy. Interactive use: a terminal interface.