1

I recently upgraded from SQL Server 2017 Express to SQL Server 2019 Express and installed Microsoft SQL Server ODBC Driver 18. However, a sqlcmd script to back up all databases, using Ola Hallengren's maintenance solution, still wants to use Microsoft ODBC Driver 17. I uninstalled Microsoft ODBC Driver 17 for SQL Server. Now I am getting the below error when I run the script in a .cmd file via the Windows Task Manager.

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

How can I get sqlcmd to use the Microsoft SQL Server ODBC Driver 18?

5
  • 1
    Did you install the 64 bit version, 32 bit version, or both? Looks like one is missing. Jul 22, 2022 at 19:30
  • I installed the 64-bit version of Microsoft ODBC Driver 18 for SQL Server.
    – Mike Pace
    Jul 23, 2022 at 3:26
  • If you opens a cmd with administrator rights, th sqlcmd runs?
    – Rodrigo
    Jul 29, 2022 at 10:46
  • Yes, but it throws the error listed above if Microsoft ODBC Driver 17 for SQL Server is not installed. I want it to run with Microsoft ODBC Driver 18 for SQL Server.
    – Mike Pace
    Jul 31, 2022 at 12:16
  • SQLCMD requires the driver version mentioned in the error message (Microsoft ODBC Driver 17). As @SeanGallardy mentioned, make sure 32 and 64 bit versions are installed.
    – Dan Guzman
    May 6, 2023 at 1:58

2 Answers 2

0

The sqlcmd script absolutely will not run Microsoft ODBC Driver 18 for SQL Server. So I am sticking with Microsoft ODBC Driver 17 for SQL Server. So be it.

0

This is the documentation that specifies the sqlcmd requirements:

sqlcmd utility

This component requires both the built-in Windows Installer 5 and the Microsoft ODBC Driver 17 for SQL Server.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.