I'm using this driver, version 160, with DelphiXE2.
Today I noticed, trough SQL Profiler, that the commands executed with sp_executesql are slower than a "clean" command.
Is there a way to fix this? Is there a parameter in TSQLQuery that not use sp_executesql?
Here it's the command with sp_executesql,
the statistics showed in Profiler was Reads: 3498, Writes: 9, Duration 140:
Code: Select all
exec sp_executesql N'UPDATE TBESTO004 SET VALUNITMOVTO = @P1 ,
QTDMOVTO = @P2 ,
VALMOVTO = @P3 ,
HISTORICO = @P4
WHERE CODEMP = @P5
AND NUMLANC = @P6',N'@P1 money,@P2 bigint,@P3 money,@P4 nvarchar(1),@P5 nvarchar(2),@P6 nvarchar(9)',$16.3750,18,$294.7500,N'',N'01',N'002667024'
Here it's the "clean command, without parameters,
the statistics showed in Profiler was Reads: 10, Writes: 9, Duration 0:
Code: Select all
UPDATE TBESTO004 SET VALUNITMOVTO = 16.375,
QTDMOVTO = 18,
VALMOVTO = 294.75,
HISTORICO = ''
WHERE CODEMP = '01'
AND NUMLANC = '002667024'