My table has 3 columns ID, ISOCode and CountryName.
Column ID is an IDENTITY column.
When I insert new records into this table, I want to populate the ISOCode field – on occasion – with the same value as the ID field.
I’ve tried SCOPE_IDENTITY(), @@IDENTITY and IDENT_CURRENT but none of these seems to work.
Is there a way I can do this?
you could write a trigger to update the ISOCode column
In Trigger use the code below