Prepared TADOQuery Question



I am using Delphi 7 and TADOQuery to attach to my SQL Server 2005.

I have the prepared property set to true, but when using the MS SQL
Profiler, it shows that query gets passed as hardcoded text to a stored
procedure. The profiler results don't change when I open/close the query.

declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,N'@P1 varchar(20)',N'select id, value from table
where value >= @P1 order by value','AREA1'
select @p1

I would have expected something like this for the second call.

exec sp_execute 1, 'AREA2'

Is there any point in using parameterized prepared queries in ADO? Or am I
using the TADOQuery incorrectly?


.



Relevant Pages

  • Re: Identity value in SQL Server 2000
    ... What should be in the FieldByName? ... >>If I use a TADOQuery to insert a record into a table has identity primary ... > the Insert query has execute. ... Acutally SQL server allows you to have both ...
    (borland.public.delphi.database.ado)
  • Re: optimize export data
    ... My app connects to MS SQL SERVER, and use a TADOQUERY to export data to ... textfile. ... SQL server comes with DTS program for import and Export. ...
    (borland.public.delphi.database.ado)
  • Re: Delph 6 TCustomADODataSet Locate method not working correctly
    ... Delphi should be able to be the interpreter between it and the SQL database, ... > components (TQuery, TADOQuery, TADODataSet, etc). ... >> Delphi I'm using the OLE DB provider for SQL Server to connect to it. ...
    (borland.public.delphi.database.ado)
  • ADO parameters and SQL IN()
    ... I have a TADOQuery (SQL server 2000) ... this should return 2 rowsbut the Query is always EOF! ... I cant find a combination that it likes. ...
    (borland.public.delphi.database.ado)