I'm trying to code the server path name in a variable for my flat file destination connection manager so it's easier to change. I don't know whether to put one backslash or two.
I've tried both and get the same error "Attempt to parse the expression "\serverfolder" failed. The token "" at line number "0", character number "0" was not recognized.
The string variable contains. \serverfolder I'm combining this with the file name also stored in a variable.
asked Dec 01 '11 at 02:25 PM in Default
You need to put double the amount of backslashes. an easy way to test this is to click on the variable, go to the properties window and click on the ellipses in the espression property.
Then type in "\\\servername\c$", and click on Evaluate Expression and it will show it as \servernamec$
EDIT: Backslashes don't work well, there are 4 at the start and 2 in the middle.
Backslashes work well for me. Here is a sample expression I use to generate a filename that starts with "Test_" and ends with today date to UNC file server destination in one of my SSIS packages:
When evaluated the above expression returns(today)
So in your case you should use: