-1

I created an SSIS variable, which I want to turn into an expression, so I write this as the Expression:

="\\livprodad1.liv.local\UserProfiles$\mike.jones\Documents\Files"

The actual link that I am referencing is: \livprodad1.liv.local\UserProfiles$\mike.jones\Documents\Files

But I get this message: Expression can not be evaluated Attempt to parse the expression failed. The expression might contain an invalid token, an incomplete token, or an invalid element. It might not be well-formed, or might be missing part of a required element such as a parenthesis.

What am I doing wrong? How should it be written?

Incompetent77
  • 71
  • 1
  • 7

1 Answers1

1

You need to double all the slashes in an expression so

"\livprodad1.liv.local\UserProfiles$\mike.jones\Documents\Files"

becomes

"\\livprodad1.liv.local\\UserProfiles$\\mike.jones\\Documents\\Files"

And if you were intending to encode

"\\livprodad1.liv.local\UserProfiles$\mike.jones\Documents\Files"

it would become

"\\\\livprodad1.liv.local\\UserProfiles$\\mike.jones\\Documents\\Files"

The leading equals sign might point to a different issue as the only explicit location that I can think of where one assigns a value is in the Expression Task. Everywhere else, there's a separate field where you list the variable you are modifying

And if the double quote is part of the expression itself, then you also escape it with a backslash \" Excellent example of escaping both on What is the escape character for SSIS Expression Builder?

billinkc
  • 59,250
  • 9
  • 102
  • 159
  • 1
    you missed the first \ in the UNC path, should be "\\livprodad1.liv.local\UserProfiles$\mike.jones\Documents\Files" becomes "\\\\livprodad1.liv.local\\UserProfiles$\\mike.jones\\Documents\\Files" – MLeblanc Aug 12 '20 at 21:12
  • 2
    @MLeblanc I went with the "The actual link that I am referencing is:" value they provided – billinkc Aug 12 '20 at 21:16