Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Execute Process Task: Failed to lock Variable Expand / Collapse
Author
Message
Posted Wednesday, September 24, 2008 8:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 31, 2008 9:54 AM
Points: 2, Visits: 11
I'm having trouble setting up the StandardOutputVariable for a Execute Process Task in SSIS. I wanted to execute a batch file SSIS with 2 parameters. I'm using the parameters to determine if the batch job completed successfully or not and capture the error message. I did the following:

1) Dragged the Execute Process Task
2) Set the executable property to: c:\user\Paul\documents\test.bat
3) Set the StandandardOutputVariable to: User::ErrorCode
4) Set the SuccessValue to: 0

Here is the test.bat code:

@Echo OFF


Echo ================== >> mybat_log.txt
Echo Start: %Date% %Time%
Echo.
Echo Start: %Date% %Time% >> mybat_log.txt


rem ==================================
rem 2>&1 sends the actual error message
rem http://technet.microsoft.com/en-us/library/bb490982.aspx
rem ===================================


C:\WINDOWS\system32\ping.exe www.google.com >> mybat_log.txt 2>&1


Echo ErrorLevel = %ERRORLEVEL% >> mybat_log.txt


IF %ERRORLEVEL% NEQ 0 (ECHO An error has occurred on the mybat.bat file.
Echo Please check the log file for more detail at D:\mybat_log.txt
) ELSE (ECHO The mybat.bat file ran successfully)


Echo.


Echo End: %Date% %Time%
Echo End: %Date% %Time% >> mybat_log.txt


Echo.
Echo —
Echo Sent from SQL Server SSIS Package


EXIT %ERRORLEVEL%

When I execute the package I receive the follow error:

SSIS package "Package.dtsx" starting.
Error: 0xC0014055 at Execute Process Task: Failed to lock variable "User::ErrorCode" for read/write access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".
Error: 0xC002F304 at Execute Process Task, Execute Process Task: An error occurred with the following error message: "Failed to lock variable "User::ErrorCode" for read/write access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".
".
Task failed: Execute Process Task
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
The program '[2556] Package.dtsx: DTS' has exited with code 0 (0x0).

Thanks in advance.
Post #575242
Posted Wednesday, September 24, 2008 9:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 31, 2008 9:54 AM
Points: 2, Visits: 11
Okay, I was able to figure out how to add a variable to the package (Right click in the package area and select add variable). The last thing I had to do to get it to work was change the variable property to type to object. Everything seems to be working fine :D
Post #575315
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse