I enabled tracing and got this at the very bottom of trace file: [ODBC][25090][1565445958.576898][SQLGetConnectAttrW.c][211]Error: SQL_INVALID_HANDLE Additionally I know it detects the server itself because there's this entry somewhere in the middle: [ODBC][25090][1565445958.570105][SQLDriverConnectW.c][290] Entry: Connection = 0x2616080 Window Hdl = (nil) Str In = [DRIVER={ODBC Driver 17 for SQL Server};SERVER={slaro};Trusted_Connection={YES};WSID={slaro};APP={SQLCMD};][length = 105 (SQL_NTS)] Str Out = (nil) Str Out Max = 0 Str Out Ptr = (nil) Completion = 0 UNICODE Using encoding ASCII 'ANSI_X3.4-1968' and UNICODE 'UTF-16LE' I'm not sure if ASCII 'ANSI_X3.4-1968' is not causing the problem. It was mentioned in documentation that this should say "UTF-8".