Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Move and renaming a file in ssis

Author  Topic 

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-06-09 : 05:51:54
Hi Guys,

I looking to move a file from one directory to another and rename the file at the same time - not a problem using File system task. however i'm also trying to Concatenate a date time stamp onto the end of the file in order to have a record of these file.

These are only simple text files, but after looking and searching google it appears that i will need to produce some .net programming to do this in the script task.

Just wondering really if anyone has even come across this type of task or links to where i can see something simlar

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-09 : 06:16:31
In DOS it would be:
echo %date%_%time%>>yourfile.txt
to append date and time to the file.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-06-09 : 07:44:13
I've got to the point were i can get the full rename file and a date stamp into a variable using a Script task however because before the script is run the variable user::fullpath is empty it won't let me add this into a file system task using the full path variable as a destination connection

any ideas
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-06-09 : 09:26:35
This is the error that im receiving at the moment, and it seems to be because the variable create dynamically in a script task in not getting passed through, any ideas where i'm going wrong

Package Validation Error (Package Validation Error)

===================================

Error at File System Task [File System Task]: Variable "FullPath" is used as a source or destination and is empty.

Error at File System Task: There were errors during task validation.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-09 : 09:43:57
Maybe this is the key to your problem.
Populate your variable not in a script task.
Do it in an expression (Properties of this variable).
Each time the variable gets referenced the expression is evaluated.

http://blogs.conchango.com/jamiethomson/archive/2005/03/19/SSIS_3A00_-Evaluating-variables-as-expressions.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-06-10 : 07:35:23
Thanks i found this which is similar which does the trick

http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/b50b6629-8fdd-472b-b8ad-cf28d2deefcb/
Go to Top of Page
   

- Advertisement -