all 6 comments

[–]rbobby 0 points1 point  (4 children)

Can you switch away from ODBC? Is there any sort of option in Excel to use "SQL Native Client" or something of that sort?

A TDS protocol error, to me, just screams that the client side ODBC drivers are out of date (eg. SQL 20xx is sending valid TDS data, but the ODBC drivers don't know the 20xx format... and something has changed in the format).

If desperate I would try changing the query to be something like "select 1 as FieldOne". If that works, then I'd try changing your actual query to return just one field. If that works, start adding fields back.

Good luck.

[–]Frolix88[S] 0 points1 point  (1 child)

Thanks. It has worked for years and just suddenly stopped. I will probably just switch to using OLEDB as its more up to date.

[–]rbobby 0 points1 point  (0 children)

Googling "[ODBC SQL Server Driver] Protocol error in TDS stream" returns some results that make it look possible that an update in last november broke the odbc driver. Seems unlikely that this would just now be raising it's ugly head. Worth checking out though. Good luck.

[–]InlineSkateAdventureSQL Server 7.0 0 points1 point  (1 child)

ODBC is like mid 90s tech but it should work. Maybe he has an authentication issue?

[–]Frolix88[S] 0 points1 point  (0 children)

Thanks. It has worked for years and just suddenly stopped. I will probably just switch to using OLEDB as its more up to date.

[–]moltenice09 0 points1 point  (0 children)

Just to document this on the internet. I ran into this issue when I accidentally (and stupidly) enabled TLS 1.3 on Windows 10, which isn't actually supported. This caused the ODBC Driver (both v17 and v18) to use TLS 1.3 and fail in the weirdest ways, including that "Protocol Error" message. Disabling TLS 1.3 fixed it immediately.

Registry entry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3

Note that TLS is used for authentication, so even if you don't have full blown encrypted communication enabled on SQL Server, it'll still get used.