1

I want to have a unique id for every time ForEach Loop Container executes in ssis packege,because i follow a serial steps like a flow and i want to have them under a unique key,I know i can Generate that key myself, but i think it might have a system variable that comes in handy in such a situation.

Hadi
  • 36,233
  • 13
  • 65
  • 124
Abolfazl
  • 1,592
  • 11
  • 32

2 Answers2

1

If you check the following documentation:

You can see that there is no system variables that store this information. On the other hand, you can refer to the following answer if you need to do it manually:

Hadi
  • 36,233
  • 13
  • 65
  • 124
1

According to Microsoft Documentation on System Variables, there is a variable System::ContainerStartTime. As the ForEach Loop is a container, you can convert DateTime value of the variable from above to a serial number, like number of seconds since 1st of Jan 1900, and use it as a sequence ID. On its own it is not completely unique; any other instance of the same package running simultaneously can generate the same seq. ID. So, it might be sufficient if you are not running same package twice.
You can make it unique mixing with System::ExecutionInstanceGUID, but it requires some coding.

Ferdipux
  • 5,116
  • 1
  • 19
  • 33