freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] SELECT @@IDENTITY AS InsertID
- Date: Wed, 16 Nov 2005 15:58:31 +0100
>
> > From: Shaun Craig
> > Sent: Wednesday, November 16, 2005 6:01 AM
> >
> > At present i've taken out my select @@identity and replaced it with
> > a select top 1 ... order by ...desc, this also gets me my identity,
> > its safe for each 'Event' as another 'Event' from the same device
> > cant be processed till this 'Event' would be finished.
> >
> > I dont use any stored procedures as code will have to be converted
> > to connect to mysql eventually.
>
> Your code will be standards-conformant and faster if you use 'select
> max(ID)' instead of "top 1 ... order by". It's much less work for the
> server, especially if (as should be the case) the ID is the first
> element of a unique index.
>
Yes, however if another connection insert a row just after my insert
max(id) returns wrong id... I think that the best option is to fix our
pool server to not reuse connection for every query. It would be perfect
if it could also "rollback" to a safe state (rollback all transactions,
close cursors, drop temporary objects and so on)
freddy77
-
Re: [freetds] SELECT @@IDENTITY AS InsertID
, (continued)
- Re: [freetds] SELECT @@IDENTITY AS InsertID, Rogers, Tom, 11/10/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
Pickett, David, 11/10/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
Shaun Craig, 11/14/2005
- Re: [freetds] SELECT @@IDENTITY AS InsertID, Shaun Craig, 11/15/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
Shaun Craig, 11/14/2005
- Re: [freetds] SELECT @@IDENTITY AS InsertID, Shaun Craig, 11/15/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
Igor Korot, 11/15/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
Shaun Craig, 11/16/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
martin, 11/16/2005
- Re: [freetds] SELECT @@IDENTITY AS InsertID, Shaun Craig, 11/16/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
martin, 11/16/2005
-
Re: [freetds] SELECT @@IDENTITY AS InsertID,
Shaun Craig, 11/16/2005
- Re: [freetds] SELECT @@IDENTITY AS InsertID, Lowden, James K, 11/16/2005
- Re: [freetds] SELECT @@IDENTITY AS InsertID, ZIGLIO, Frediano, VF-IT, 11/16/2005
- Re: [freetds] SELECT @@IDENTITY AS InsertID, Pickett, David, 11/16/2005
Archive powered by MHonArc 2.6.24.