Skip to main content
3 of 3
Clarity
Sting
  • 2.8k
  • 12
  • 20

If I'm hearing what you're saying correctly, consider making your batch_id "match" an uploaded document by adding in your procedure something like:

declare @batch_id uniqueidentifier 
select @batch_id = newid()
insert into main_table (employee_id, name, email, ... batch_id) values (101,'Max Chan','[email protected]', @batch_id)
insert into main_table (employee_id, name, email, ... batch_id) values (102,'Next User','[email protected]', @batch_id)

That way, the batch_id will match the uploaded document. And, no batch_ids will be the same using the GUID approach.

Sting
  • 2.8k
  • 12
  • 20