I am trying to use vim+dbext to run queries on an AzureSQL db using sqlcmd
. The Result window shows an error:
Connection: T(SQLSRV) S([SERVER]) D([DB]) U([USER]) at 17:05 job started:17:05:47 updates every 2000 ms To change connection parameters: :DBPromptForBufferParameters Or :DBSetOption user|passwd|dsnname|srvname|dbname|host|port|...= :DBSetOption user=tiger:passwd=scott Last command(rc=1): sqlcmd -U [USER] -P[PASS] -S [SERVER] -d [DB] -i C:\Users\LOCAL_~1\Temp\dbext.sql Last SQL: select * from [TABLE] where [COL] = 'VALUE' go job ran for less than 2000 ms
If I run the command exactly as it appears manually in Command Prompt, it returns valid results. I believe sqlcmd is a 64 bit version. It's located in C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\SQLCMD.EXE
and is in the path.
The dbext config for this profile is:
let g:dbext_default_SQLSRV_bin = 'sqlcmd' let g:dbext_default_SQLSRV_cmd_options = '' let g:dbext_default_profile_[name] = 'type=SQLSRV:user=[USER]:passwd=[PASS]:dbname=[DB]:srvname=[SERVER]'
I tried this with and without the cmd_options
line. How can I diagnose what is going wrong?