I am using SQL Server 2016
and SSIS
. I have a package in which I am calling a sql server job.
My job have just one step as PowerShell command
for transfering all files from one directory to another directory between two servers.
When I run my job from SQL server, it works well.
When I run my package from VisualStudio
, every things is ok, but after deploying my project to sql server, when I want to run this package from SQL Server, I have this error :
Execute SQL Server Agent Job Task: Error: Failed to lock variable "RunId" for read access with error 0xC0010001 "The variable cannot be found. This occures when an attempt is made to retrive a variable from the Variable collection on a container during execution of package, and the variable is not there. The variable name may have changed or the variable is not being created.".
I deleted the Execute sql server agent job task
from my package and I redeployed my project and now I do't have this error. It is clear that error is about Execute sql server agent job task
.
I have more than 2000 files in source directory and it takes several minutes to transfer all files to destination directory.
Edit1 : I have several Task and component in my package and the last ones is Execute sql server agent job task
and i don't have Execute T-SQL Statement Task
.