Neven
Thanks for that. You are of course correct with the first point. It's been
a while since I did any Interbase, but from my memories of writing the
generator incrementing code, I felt that the default behaviour of an
IDENTITY field was the same as when using Interbase generators. As I
usually try to keep away from triggers in SQL Server I find the IDENTITY
functionality not only adequate but very simple to use ie:
INSERT INTO Clients (Name) VALUES (@Name)
SET @ClientID = @@IDENTITY
INSERT INTO Accounts (ClientID, AccountID)
SELECT @ClientID, AccountID FROM Accounts
But your second point does concern me. Basically you're saying that under
stress and with multiple connections, an identity column may return the same
value twice. Can you point me to a link that confirms that? I understood
they were pretty much bullet proof.
Paul.
> -----Original Message-----
> From: Neven MacEwan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 12 January 2001 08:49
> To: Multiple recipients of list delphi
> Subject: Re: RE: [DUG]: [DUG-DB]: Unique IDs
>
>
> Paul
>
> Sorry I wasn't quite clear I meant @@Identity
>
> ie
>
> If the statement fires one or more triggers that perform inserts that
> generate identity values, calling @@IDENTITY immediately
> after the statement
> returns the last identity value generated by the triggers.
>
> And as I understand it is only guaranteed per connection so connection
> pooling can stuff it up (under heavy loads)
>
> Neven
>
> ----- Original Message -----
> From: Paul Ritchie <[EMAIL PROTECTED]>
> To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
> Sent: Thursday, 11 January 2001 18:04
> Subject: RE: RE: [DUG]: [DUG-DB]: Unique IDs
>
>
> > Neven,
> >
> > Well you learn something new every day eh?
> >
> > > a/ They are only unique to a connection and
> >
> > I didn't think so. Aren't they generated from within the
> database? I use
> > them in stored procedures and I don't see how they could be
> only unique to
> a
> > connection. Can you point me to documentation to that effect?
> >
> > > b/ They are only held for the last action.
> >
> > So is the current value of a generator. Isn't that the same thing?
> >
> > Paul.
> >
> --------------------------------------------------------------
> ------------
> -
> > New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> > Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> >
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"