Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server: Data source name not found and no default driver specified

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server: Data source name not found and no default driver specified

Solution:

  • Download ODBC Driver 11 – “msodbcsql.msi”

https://www.microsoft.com/pt-br/download/details.aspx?id=36434

  • put file some folder
  • Install this file directly on the PC, or install it remotely with PSEXEC or otherwise

C:\> msiexec /quiet /passive /qn /i msodbcsql.msi IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL

  • case should you decide to run remotely

++++++++++++++++++++++++++++++++++++++++++++++++++++

C:\> psexec \\remote_ip -s cmd

PsExec v2.11 – Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals – www.sysinternals.com

Microsoft Windows [versão 10.0.18362.1016]
(c) 2019 Microsoft Corporation. Todos os direitos reservados.

C:\Windows\system32> cd \

C:\> cd install

C:\install> msiexec /quiet /passive /qn /i msodbcsql.msi IACCEPTMSODBCSQLLICENSETERMS=YES ADDLOCAL=ALL

++++++++++++++++++++++++++++++++++++++++++++++++++++

Note:
If the error is in another ODBC version, download the file for that version.

Ex.:

  • if error: Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Data source name not found and no default driver specified
  • Solution: download and install “ODBC Driver version 17”