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

Getting Error for Dynamic file name Expand / Collapse
Author
Message
Posted Wednesday, October 03, 2012 10:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: 2 days ago @ 5:07 AM
Points: 8, Visits: 73
Hey I am also working on same task like this In SSIS ftp task...

Here I created a variable for getting dynamic file name path for
"LOCAL PATH"..
@[User::LDirectoy] = "E:\LocalFilefolder\"
@[User::LZipFilePrefix] = "KK_"
@[User::LZipFileEndExtension] = ".rar"

@[User::LDirectoy]+ @[User::LZipFilePrefix] + (DT_STR, 4, 1252) DAY( DATEADD("dd", -1, GETDATE() ) )+"-"+RIGHT("0"+(DT_STR, 4, 1252) MONTH( GETDATE() ),2)+"-"+(DT_STR, 4, 1252) YEAR( GETDATE() )+ @[User::LZipFileEndExtension]
op: for this expression.." E:LocalFilefolder/KK_26-09-2012.rar"

while debugging i am getting
Error: Failed to lock variable "E:\LocalFilefolder\KK_26-09-2012.rar" 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.".



Any help will be apreciated.......
Post #1367861
Posted Tuesday, October 09, 2012 12:36 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, April 07, 2014 5:43 PM
Points: 35, Visits: 89
I am assuming you are getting the error in a script task. That happens when you are trying to access a vraibale inside the script without first specifyinf it on the container in the
'ReadOnly Variables' and the 'WriteOnly Variables' section.
Post #1370534
Posted Wednesday, October 10, 2012 4:09 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 4:25 AM
Points: 4,828, Visits: 11,184
n79799 (10/9/2012)
I am assuming you are getting the error in a script task. That happens when you are trying to access a vraibale inside the script without first specifyinf it on the container in the
'ReadOnly Variables' and the 'WriteOnly Variables' section.


I think you meant Read/Write variables. Write-only variables have limited use.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1370815
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse