TDS and SQL Batch


I am developing a sample TDS communication from an industrial controller to the SQL Server.
For this I use the TDS protocol.

Already working is PreLogin and Login (I get "LoginAck"). (With an own Login created.)

If I try to execute the example SQL Batch (/
the connection is Logged out without the expected response. I also tried other SQL Batch SQL statements with the same result. As soon as I send SQL Batch the Connection is dropped.
I search so much already (permissions, ...) But I have no Idea anymore.

BTW: I monitor that with Wireshark. - That has nothing to complain about that Messanges.

Has anybody an idea what I could have misconfigured or what

I need to configure to get the result to SQL Batch (TDS) ?

Many thanks in advance!

Best regards


In the end I found it myself.
It was that I enabled MARS in PRE_LOGIN.
But because I don't have MC-SMP protocol this was not working.
Setting MARS to 0x00 and everything in my unencrypted connection works fine.


Hello Gregor

I stuck same problem like you and i changed to pre login message but i took same error could you help me ?