Re: When Do You Use a Trigger To Populate Sequenced Prime Key?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 29 Jan 2003 16:31:04 -0800
Message-ID: <2687bb95.0301291631.1423055c_at_posting.google.com>


"Simeon Rice" <tampa_at_bucs.com> wrote in message news:<_vVZ9.492964$y74.3423905_at_news.easynews.com>...
> When would you use an insert trigger to populate the key rather than just a
> sequence.nextval on your insert statement?
>
> I'm reviewing the triggers in a database that I'm currently working on (for
> a 3rd party app) and I noticed they used trigger method for certain tables.
>
>
> Thanks.

You could expect to see this for application written first for SQLServer and the autonumber datatype where the rdbms automatically plugs a value into the column and the insert code does not include the column.

Then you would do the same to support any application where you did not intend to require referencing the sequence generator in the insert statement.

Just my 2 cents. -- Mark D Powell -- Received on Thu Jan 30 2003 - 01:31:04 CET

Original text of this message