In my trivial example below I have a Nationality entity. The entity just has the code and Name attributes, with the code being an automatically generated Integer.
Im inserting one record and then trying to prevent the same record being inserted, by setting the ImportType to 1:
truncate table [stg].[Nationality_1_Leaf] insert into [stg].[Nationality_1_Leaf](importType, ImportStatus_id, BatchTag, Name) values(1, 0, 'some batch' , 'American' ) select * From [stg].[Nationality_1_Leaf] exec stg.udp_Nationality_1_Leaf 'VERSION_1', 1, 'some batch'
After this I truncate the staging table and repeat the process. Unfortunately a new record is entered into the Entity even though the name is identical to a record that already exists.
Can anyone explain what im doing wrong here?