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..

pyram
  • 925
  • 9
  • 24
  • 43
  • 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 http://stackoverflow.com/questions/13961534/ssis-2008-pass-value-to-query – billinkc Dec 21 '12 at 17:53

1 Answers1

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
praveen
  • 12,083
  • 1
  • 41
  • 49