0

im using SSIS for Sql server 2008.

Im declaring a path on a string variable on the Expression property:

"C:\\data\\Documents\\dt\\local." + @[User::Record] + ".xlsx"

The User::Record is of type Object.

I want to know how can I convert it from Object to String so I can assign it on the path.

Thanks..

1
  • 1
    You cannot do anything with an SSIS variable of type Object in an the expression editor. You need to slice out the zeroeth element of the @[User::Record] and assign it to @[User::ParameterValue] as noted in my answer stackoverflow.com/questions/13961534/… Commented Dec 21, 2012 at 17:53

1 Answer 1

1

Expression is evaluated at compile time .So the variable User::Record is initialized as System.Object type .It does not contain any value .

Instead of declaring it as an expression ,try to use a script task to assign the path to the string variable .

Dts.Variables["User::Path"].Value =
"C:\\data\\Documents\\dt\\local." + Dts.Variables["User::Record"].Value.ToString() + ".xlsx"

I assume that before assigning the path to the string variable you are storing some value in User::Record variable . Else even after the above script task code ,your path variable will hold the value

C:\data\Documents\dt\local.System.Object.xlsx
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.