Issue with DescribeParams on SQL Server 2022

Issue with DescribeParams on SQL Server 2022

Hi,

we are migrating from SQL Server 2012 to SQL Server 2022 and have a problem with using property DescribeParams of TMSQuery component and calling Prepare.

MSQuery1.Options.DescribeParams := True;
MSQuery1.SQL.Clear;
MSQuery1.SQL.Add('SELECT TOP 10 *');
MSQuery1.SQL.Add('FROM events');
MSQuery1.SQL.Add('WHERE code = :code ORDER BY dt DESC;');
MSQuery1.Prepare;
MSQuery1.ParamByName('code').AsString := '0001';
MSQuery1.Open;

The code above throws exception "SQL statement doesn't return rows." The same code runs fine on SQL Server 2012.

We are using Devart SDAC 11.0.0 Professonal for Delphi XE 7.


Kind regards,
Tim