Microsoft
Software
Hardware
Network
Question : File System Task to rename file giving failed to lock variable error
I have a File System Task in place to rename a file
File Exist in the following folder in this format [This is the Source]
This file would be available daily,with current timestamp
C:\A_20081029.txt
File at source to be renamed to [At Destination,which is the same location as Source]
C:\A.txt
Here is what has been done so far in File System Task
Is Destination Path Var : True
DestinationVar : User :: DestinationFileName
OverwriteDestination : True
Is Source Path Var : True
Source Var :: SourceFileName
In Expression Tab
Create new Expression
Source : @[User::SourceFileName]+ (DT_STR,4,1253)YEAR(GETDAT
E()) + RIGHT("0" + (DT_STR,2,1253)MONTH(GETDA
TE()),2) + RIGHT("0" + (DT_STR,2,1253)DAY(GETDATE
()),2) +".txt"
Evaluate Return : C:\A_20081029.txt
SSIS Tab > Variable Created as
SourceFileName / String / Value : C:\A_
DestinationFileName / String / Value : C:\A.txt
When I execute,I get an error mssg as below
TITLE: Package Validation Error
--------------------------
----
Package Validation Error
--------------------------
----
ADDITIONAL INFORMATION:
Error at File System Task [File System Task]: An error occurred with the following error message: "Failed to lock variable "C:\A_20081029.txt" for read 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 at File System Task: There were errors during task validation.
(Microsoft.DataTransformat
ionService
s.VsIntegr
ation)
--------------------------
----
BUTTONS:
OK
--------------------------
----
Answer : File System Task to rename file giving failed to lock variable error
Question PAQ'd, 250 points refunded, and stored in the solution database.
Random Solutions
C# -- Microsoft Report (.rdlc) textbox "HEIGHT" ?
Stored Procedure Fails To Populate Recordset
How to input form data into table or query
Internet explorer crashes
T-SQL: calculate totals in SELECT statement witout GROUP BY
ranking records and determining percentage of total in access 2007
Sum column in datagrid
Uneccessary Programs/ addons ...things that take up internet bandwidth that can be removed.
MS Access Macro Auto Select Both Combo Box and Text Box at Same time in Same form
how to pull week day and time from a query