How to Identify Multiple Insert Rows from Single Transaction Is there method to identify multiple rows from single insert transaction?

IdentityId will uniquely identify each row. If 2000 rows were inserted from one insert transaction, how would I identify this? Is there like a BatchId() Identifier or TransactionId() reserved word? Using ETL default getdate() will not work, sometimes a transaction could span over milliseconds.

EG:

begin transaction
insert into dbo.Test2
select * from Test where ColumnA = 'etc...; 
commit transaction 


Refraining from using pattern below, may be inefficient, is there a  reserved keyword for batch transaction identifier?

select @MaxTransactionId = (select Max(transactionId) from dbo.Test2), 
TransactionId = @MaxTransactionId + 1,
I would suggest using SEQUENCE
It is simple and the sequence value always increases in one way

-- you only need to create it once
create sequence seq as int start with 1
go

-- you can then do this
BEGIN TRANSACTION;
DECLARE @BatchID int = next value for seq
INSERT INTO dbo.Test2
       SELECT *, @BatchID AS [batch_id]
       FROM Test;
COMMIT TRANSACTION;