Page 1 of 1

Query with parameters very slow with Delphi XE

Posted: Wed 14 Sep 2011 20:08
by wloeppky
Delphi XE, using latest DevArt driver. I have found queries that are using paramters are very slow compared to using a plain query with no paramters.

For example"
select * from Tablex where Store = :Store

is way slower than

select * from Tablex where Store = '001'

This was not hapenning in Delphi 7. I did notice using the activity monitor that it is using CONVERT_IMPLICIT for nvarchar paramters. Looks like unicode string are being passed as paramters.

Appreciate any help you can provide.

Wayne

Posted: Thu 15 Sep 2011 11:42
by AndreyZ
Hello,

This behaviour is connected with the specificity of SQL Server work. Sometimes small queries with parameters are executed slower than queries without parameters. We cannot influence such SQL Server behaviour.