The collection of variables locked for read and write access is not available outside of PostExecute error in SSIS


We might get this error while trying to access a ReadWrite variable within Script Component outside Post Execute.

Here we were using it within ProcessInputRow method

As per the official documentation – the reason for this error is because ReadWriteVariables are only available inside PostExecute method for improved performance and minimizing locking.

https://docs.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/data-flow-script-component/using-variables-in-the-script-component?view=sql-server-2017

Updating the code to use PostExecute method fixed the issue for us.

Hope it helps..

Advertisements

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “The collection of variables locked for read and write access is not available outside of PostExecute error in SSIS”

Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.