[DUG] MSSQL Question

Kyley Harris kyleyharris at gmail.com
Mon Dec 1 20:09:11 NZDT 2008


The main difference is that a Generator is more like an Oracle Sequence, It
is table independant, which allows you to use the same sequence accross more
than one table,
and you can also have more than one per table. I find the identity is only
useful if it is to be a primary key, not useful as a data element.

On Mon, Dec 1, 2008 at 5:12 PM, Neven MacEwan <neven at mwk.co.nz> wrote:

> John
>
> Really interbase generators are more akin to the mssql identity column
> type, the problem with mssql identity columns WAS
> with the @@Identity variable which was per connection (and hence
> triggers that inserted other identity columns not return the identity
> you would expect),  this has been 'fixed' with the SCOPE_IDENTITY()
> function
>
> Stangely identity columns and generators behave the same way, ie they
> are both not rolled back by a trans
>
> PostgeSQL, uses a combo of both a column type of 'serial', which auto
> generates a 'sequence'
>
> Of course I could be spouting BS.
>
> Neven
> //
> > Whats others opinion on the merits of trggers etc as discussed here vs
> the
> > Firebird/Interbase method of using generators?
> >
> > I have often wondered if this is an area where Firebird/Interbase has a
> less
> > convenient but more transparent mechanism - where you have to fire a
> > generator to get a new key value before you start putting data in a new
> > record.
> >
> > And the generator never rolls back even if the transaction does -
> avoiding
> > the lock problem.  Mostly in
> > my experience this is fine, except some times when the ID numbers (eg
> batch
> > numbers) are supposed to be strictly sequential and then you have to get
> the
> > next value from a SQL query, and make sure no-one else is running another
> of
> > the same batch at the same time.  (In those situations the main thing
> that
> > protects the database is that only one staff member ever runs this batch
> > operation - I bet thats how a lot of databases run in practice)
> >
> >
> > John
> >
> > _______________________________________________
> > NZ Borland Developers Group - Delphi mailing list
> > Post: delphi at delphi.org.nz
> > Admin: http://delphi.org.nz/mailman/listinfo/delphi
> > Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
> >
> >
> >
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>



-- 
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20081201/3d3d8cd8/attachment.html 


More information about the Delphi mailing list