SSIS 2008: Illegal characters in path when trying to rename a file
0
votes
1
answer
862
views
I have a task that should rename a file
I have a variable called RenameFileName
\\servername\csv\BACKUP\" + (DT_WSTR,4)DATEPART("yyyy",GetDate()) + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + ".csv
When I run the task I get the error
Illegal characters in path
Am I doing anything wrong? Below are a list of the variables I have tried
\\\\servername\\csv\\BACKUP\\" + (DT_WSTR,4)DATEPART("yyyy",GetDate()) + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + ".csv
\\servername\csv\BACKUP\" + (DT_WSTR,4)DATEPART("yyyy",GetDate()) + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + ".csv
"\\servername\csv\BACKUP\" + (DT_WSTR,4)DATEPART("yyyy",GetDate()) + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + ".csv"
"\\\\servername\\csv\\BACKUP\\" + (DT_WSTR,4)DATEPART("yyyy",GetDate()) + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + ".csv"
Please note that the following works:
\\\\servername\\csv\\BACKUP\\ABC.csv
This however does not work
\\\\servername\\csv\\BACKUP\\"+1+".csv
It errors as soon a I put in double quotes. Single quotes are fine and they get put in the filename
Thanks
Asked by pee2pee
(194 rep)
Feb 11, 2021, 12:37 PM
Last activity: Feb 11, 2021, 03:30 PM
Last activity: Feb 11, 2021, 03:30 PM