in reply to DBD::ODBC, bind_param_inout

I don't really know how DBD::ODBC works, but based on my understanding of the TDS protocol I suspect that you can't use bind_param_inout() with a multi-statement request (using the declare in the code above makes this a multi-statement request).

However, as you don't get an error from DBD::ODBC itself during the prepare() I would think that this is either a bug in DBD::ODBC, or a problem with FreeTDS that doesn't quite handle the OUTPUT parameters as it should (the fact that the data is returned in the driver trace doesn't necessarily mean that the driver decodes the data correctly.) As FreeTDS is very much a work in progress, and as OUTPUT parameters from MS-SQL have only just been added I would suspect the latter.

I think you've already posted this to the FreeTDS mailing list - I suggest following up over there...

Michael