[DUG] MSSQL Question
John Bird
johnkbird at paradise.net.nz
Mon Dec 1 16:50:38 NZDT 2008
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
More information about the Delphi
mailing list