Forum Discussion
After insert trigger on a table that has a Primary Key
- May 23, 2018
Hi Ahmad,
I'm not sure to fully understand your need, but please consider the following bullet :
- From performance perspective, triggers are not the best way to go.
- Why don't you allow your Order record to be childless, and then add a record into the Delivery table after, via user interface typically ?
Finally, to keep your solution in place :
- Define your DeliveryID column as a BigInt, and enable the Identity property to True (ref your screenshot). Then the value of your DeliveryID column will be automatically incremented for each new record.
- Define your DeliveryID column as a UniqueIdentifier, and define a default value as new_sequentialid().
Hope this helps.
Fred.M.
Hi Ahmad,
I'm not sure to fully understand your need, but please consider the following bullet :
- From performance perspective, triggers are not the best way to go.
- Why don't you allow your Order record to be childless, and then add a record into the Delivery table after, via user interface typically ?
Finally, to keep your solution in place :
- Define your DeliveryID column as a BigInt, and enable the Identity property to True (ref your screenshot). Then the value of your DeliveryID column will be automatically incremented for each new record.
- Define your DeliveryID column as a UniqueIdentifier, and define a default value as new_sequentialid().
Hope this helps.
Fred.M.
- Ahmad SalehJun 05, 2018Copper ContributorThank you, for the suggestions