@whytheq's answer works for "Integrated Windows Authentication", but if you want to connect using Active Directory Integrated authentication, which is installed with SQL Server Management Studio, you'll need to:
Make sure that the 32 bit version of
sqlcmd.exe
is on your search path by opening PowerShell and typingget-command sqlcmd
and making sure that the source path starts withC:\Program Files (x86)\
. If if doesn't you need to addC:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn
to your System's Path environment variable (before any paths which include the 64 bitSQLSRV.exe
, of course).Tell dbext to use
SQLSRV
instead ofOSQL
to execute queries by adding this to your_vimrc
(ideally in anaugroup
as the dbext readme suggests):let g:dbext_default_SQLSRV_bin = 'sqlcmd' let g:dbext_default_SQLSRV_cmd_options = '-b -G -N'
Note that the
-G
tellsSQLSRV
to use the Active Directory Integrated Authentication, and the-N
is for encrypting the connection.
Aside: Oddly, requesting a secure connection (-N
) from a server that enforces a secure connection can result in an error message stating SSL Provider: The target principal name is incorrect
, in which case you'll want to drop the -N