0

A vendor has a SQL azure database I need to connect to. They advised I will need the oledb 19 drivers, which I have installed.

I can connect from Visual Studio, and from SSMS v17.9.1. I cannot however connect via a UDL file, SSMS 19.1 or azure data studio.

This leads me to think it could be a 32 bit / 64 bit issue. Older SSMS uses 32 bit drivers, as does Visual Studio, but Azure Data Studio & UDL both use the 64 bit driver.

The error I am getting is as follows:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (Microsoft SQL Server, Error: 64)

enter image description here

Appreciate any advice on how to resolve this.

4
  • Please Edit your question to include the output from clicking on the Copy Message button - as text, not screen shots. It should include a stack trace which would be more revealing than just the error message by itself. Commented Aug 3, 2023 at 21:44
  • The specified network name is no longer available is usually a "transient" error - that is, you should try connecting again and it might work. I see it when connecting on SSMS about 5% of the time. I just need to reconnect Commented Aug 4, 2023 at 0:41
  • Hi @Nick.McDermaid, unfortunately it's occurring consistently. Commented Aug 4, 2023 at 10:59
  • So when successful is the connection (almost) immediate, whereas this failure message occurs after 10-15 seconds? Just to be certain, can you connect and run SELECT @@VERSION. You've tagged Azure SQL Database, but there can be some ambiguity around this. Commented Aug 6, 2023 at 2:06

1 Answer 1

0

Usually, this error is associated with timeouts on connections, and some timeouts occurring during the handshake phase. When you try to connect to Azure SQL set the timeout to 30 seconds at least, and make sure you encrypt the connection and trust server certificate on the connection string:

enter image description here

The issue is not related to 32-bit drivers or 64-bit drivers, you can get the same error with .NET and the .Net SqlClient Data Provider, for example (32-bit and 64-bit). These tools SSMS and Azure Data Studio support "Microsoft OLE DB Driver for SQL Server" (see the link on the next paragraph) and Microsoft ODBC Driver 17 for SQL Server also. Try them.

About the UDL connection please make sure you use MSOLEDBSQL provider which supports TLS 1.2 and Azure Authentication.

Sign up to request clarification or add additional context in comments.

1 Comment

hi, thanks for the reply. timeout was already set at 30 seconds. the error comes back in about 10-15 seconds. connection is encrypted and trust server certificate checkbox is ticked.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.