Abolfazl
Abolfazl

Reputation: 1700

Is there any unique id for each time ForEach Loop executes in ssis packages?

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.

Upvotes: 1

Views: 443

Answers (2)

Ferdipux
Ferdipux

Reputation: 5256

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.

Upvotes: 1

Hadi
Hadi

Reputation: 37348

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:

Upvotes: 1

Related Questions