Re: the "where" part of the update statment



Ok, the secret seems to be in

ADCPROP_UPDATECRITERIA_ENUM

Thank you very much indeed!

"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> wrote in message
news:%23P23nXr8GHA.1496@xxxxxxxxxxxxxxxxxxxxxxx
Fotis Mylonas wrote:
Hallo,
i noticed in the sql profiler that the ADO dataset

"dataset"? Are you talking about ADO.Net? Classic ADO has no dataset
object: it has a recordset object. Is that what you were referring to?

If you actually meant "dataset", then you are posting to the wrong
group. Try microsoft.public.dotnet.framework.adonet. There are also
forums at www.asp.net where you can find a lot of people to help you.

If you are using ADO.Net, then disregard the rest of this reply.

produces an update
statment with many "AND" like:

update table set field=value
where primary key=value and this and that and the other and so on.

i understand this is used in a lock optimistick scenario in order to
catch possible changes that may have happned from other users, on the
same row i had modified.

No, that is not the only reason. See
http://web.archive.org/web/20010417214447/http://mspress.microsoft.com/books/ww/sampchap/3445.htm

But what if i dont want to use this locking mechanism and instead use
mine? How can i still use batch optimistic mode
and at the same time
instruct the ado dataset to use only the primary key column in the
update statement? This has tramendous diference in perfomance in
large tables.
We cannot index every column of course.
Any help?

If you are using SQL Server, use a stored procedure for updates instead
of the recordset.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.




.



Relevant Pages

  • Re: the "where" part of the update statment
    ... i noticed in the sql profiler that the ADO dataset ... instruct the ado dataset to use only the primary key column in the ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • the "where" part of the update statment
    ... statment with many "AND" like: ... i understand this is used in a lock optimistick scenario in order to catch ... ado dataset to use only the primary key column in the update statement? ...
    (microsoft.public.data.ado)