Tuesday, March 27, 2012

Duplicate row using trigger

I have a database with a table that stores details about a computer base unit. This can be identified using a unique ID which is stamped on the top of each case.

Sometimes an old PC gets replaced with a new one, but the old monitor etc. are retained. It would be good to have a way of duplicating a row so that the records for the monitor etc. are updated to use the new unique ID. However, it would be good to have a copy of the old base units details copied into a record with its ID number.

I was thinking about doing this via. a trigger, does anybody have any better suggestions about how this may be done?

Thanks,
PaulU can use flag separate for identifying old and new.
depending on this u can use auto-incremented values each time.

it will be better if u can send me some sample data so that i can give u a better suggestion.

No comments:

Post a Comment