In your base table, store each part in separate columns.
If possible, store the most useful information you can rather than just codes.
Next, create a view that includes all the original columns as well as a calculated column that figures out what the code should be.
That way you get the best of both worlds: the proper code is kept up to date and you still have the original information to refer to easily.