Share via

When SQLCMD with ODBC Driver 19 will be available ?

Neeraj Saxena 26 Reputation points
2022-09-22T15:13:59.027+00:00

Latest Version of SQLCMD cannot be used in "TLS1.2 only" environment, because it is still using ODBC Driver 17.
Wherein we have now ODBC Driver 19 available which works well with database hosted with "TLS1.2 only" connectivity.

For such SQL servers, SQLCMD cannot connect successfully, if we disable TLS1.0 and TLS1.1, but keep TLS1.2 enabled
We get this error:

"SSL Error: unable to establish connection and underlying connection is closed by server"

If I enable TLS1.0 and TLS1.1 also, SQLCMD connects well.

SSMS connects well whether you enable TLS1.0/1.1 or not

Any Idea when the new build of SQLCMD with ODBC Driver 19 be available, MS does not seem to be paying any attention towards it ?

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


3 answers

Sort by: Most helpful
  1. Tom Phillips 17,786 Reputation points
    2022-09-23T18:46:08.897+00:00

    What version of Windows is the CLIENT using?

    The error you are getting, indicates the CLIENT is not setup to support TLS 1.2. This is not a problem with the SQL Server. The reason it works when you enable 1.0/1.1 is because is it connecting using 1.1.

    https://learn.microsoft.com/en-us/windows/win32/secauthn/protocols-in-tls-ssl--schannel-ssp-

    Was this answer helpful?

    0 comments No comments

  2. YufeiShao-msft 7,156 Reputation points
    2022-09-23T07:25:38.77+00:00

    Hi @Neeraj Saxena

    ODBC Driver for SQL Server 18.1 released on Aug, 2022, it is the latest version, what is the ODBC Driver 19 available you said

    About the error you can see this doc:

    KB3135244 - TLS 1.2 support for Microsoft SQL Server

    You can try to manually create the registry key on the system that hosts the Reporting services configuration manager

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client : "Enabled"=dword:00000001  
    

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

  3. Dan Guzman 9,516 Reputation points
    2022-09-22T18:16:15.283+00:00

    I see from your question edit that you are using PowerShell Invoke-sqlcmd. This does not use the SQLCMD command-line utility nor OLE DB or ODBC drivers. The PowerShell cmdlet uses the .NET framework SqlClient API. Make sure you client machine is up-to-date with the latest .NET Framework patches that support TLS 1.2

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.