Re: the "where" part of the update statment
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 09:04:09 -0400
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 useIf you are using SQL Server, use a stored procedure for updates instead
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?
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.
.
- Follow-Ups:
- Re: the "where" part of the update statment
- From: Fotis Mylonas
- Re: the "where" part of the update statment
- References:
- the "where" part of the update statment
- From: Fotis Mylonas
- the "where" part of the update statment
- Prev by Date: the "where" part of the update statment
- Next by Date: Re: the "where" part of the update statment
- Previous by thread: the "where" part of the update statment
- Next by thread: Re: the "where" part of the update statment
- Index(es):
Relevant Pages
|
|