Thanks Kunt and Andy for the replies.
I have a table which stores group and the linked operation. When ever the operation linked to group changes. The system deletes all the rows for that group and reinserts all the new changes. I am using triggers to capture all the changes in this table. My trigger inserts into a temp table when ever there is insert to the original table. This is working as expected. I need something (transaction id) to group inserts for a group together so that i can put sequence as in 1,2,3 etc.
Example
Suppose Group A can have 1,2,3,4 operations. When the group is created the trigger will insert four rows for group into temp table. I want something using which I can tie these rows together and put a change count 1. Suppose later the group is changes to have five operation 1,2,3,4,5. The trigger will again insert these five rows into temp table. Again here I want to put a change count of 2 to this group. The logic should apply for all the group changes.