sqlcmd
sqlcmdMicrosoft's command-line tool for querying and managing SQL Server.
Microsoft's command-line tool for querying and managing SQL Server.
Connect to SQL Server with sqlcmd and run a query or script file, or open the interactive prompt. Passwords (-P) are left out so they do not land in shell history; contexts and the modern subcommands are not covered.
serverdatabasetrusteduserqueryexit_on_errorserverdatabasetrusteduserinput_fileoutput_fileexit_on_errorstring-Sstring-dstring-Uboolean-Eboolean-Gboolean-Cstring-Qpath-ipath-oboolean-bboolean-Wstring-sdocsmanual2026-10-27Before it fills your prompt, Otty checks the installed sqlcmd against its version. A form that does not match your version is not offered.