sql-server-2014sqlcmdsystem-error

Microsoft ODBC Driver 11 for SQL Server : Specified driver could not be loaded (msodbcsql11.dll)


when I try to run the sqlcmd command in the command line, I get the following error message:

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Specified driver could not be loaded due to system error 193: (ODBC Driver 11 for SQL Server, C:\Windows\system32\msodbcsql11.dll)

I checked "C:\Windows\system32\" directory and I can see that the the dll is located correctly:

DLL is located in the directory

I also double checked that "Microsoft ODBC Driver 11 for SQL Server" is installed (version 12.0.2000.8).

OS: Windows Server 2012 R2 Standard

SQL Server Version: Microsoft SQL Server 2014 - 12.0.2000.8 (X64) Feb 20 2014 20:04:26 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: )

Any ideas why I cannot run the command sqlcmd in the command line?

Thanks a lot in advance, Roman


Solution

  • I downloaded Dependency Walker and realized that msodbcsql11.dll is really x86 instead of x64. I replaced the DLL and everything works fine.

    Thanks for your help, Roman