Hello,
the 'select @@IDENTITY' returns last IDENTITY after the insert, in your case, last IDENTITY value is value of the record inserted into the RelationshipList_Changes.
-Example steps:
1. insert records to RelationshipList table
2. database generates new IDENTITY value for new record in RelationshipList table
3. Your insert trigger executes insert to RelationshipList_Changes table
4. database generates new IDENTITY value for new record in RelationshipList_Changes table
5. Your statement 'select @@IDENTITY' returns value of last IDENTITY in RelationshipList_Changes
Please change your SQL Statement in GeniusConnect Primary/Mandatory keys dialog to:
select ClientID from RelationshipList_Changes where TranNr=@@IDENTITY