|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:18 AM
Points: 772,
Visits: 1,825
|
|
Wayne West (6/11/2008) Which is why my Yahoo mail does not download images...
Likewise I have killed all the preview panes in Outlook and don't use Outlook Express for my home e-mail.
ATB
Charles Kincaid
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Today @ 3:00 PM
Points: 93,
Visits: 502
|
|
I'm pulling my hair out over this. I'm trying to pass the value of a package variable to a batch command script running in a SSIS Execute Process Task. I thought I'd found the answer in this article, on how to set the Task's Arguments property using an Expression, rather than hard coding an Arguments value. But when I set use this expression for the Arguments: Arguments | "(DT_STR, 4, 1252) @[User::RowCnt]", I don't get the value for the RowCnt variable (eg, 15), I get this literal value (DT_STR, 4, 1252) @[User::RowCnt] passed into my command script.
Any ideas what I'm doing wrong here?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Saturday, February 02, 2013 8:21 AM
Points: 283,
Visits: 268
|
|
Can you include a brief code snippet, I can't really understand what you're doing to pass the variable.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Today @ 3:00 PM
Points: 93,
Visits: 502
|
|
Hi, sorry for the confusion; I'm a newbie to SSIS, but a veteran of SQL Server. I'm not sure what you're asking for. I think you're asking to see my Execute Process Task's property settings. I don't know how to output the property settings in a print-friendly way to include in this post. If there is such a way, please set me know.
What I'm trying to do seems simple. I have a DOS command script that I want to call using the Execute Process Task. The script takes 1 parameter, a number. When I call it manually from a Command prompt and pass a number as a parameter, all is well: C:\scripts\myscript.cmd 6
In my package, I have a package variable of type Int32, named RowCnt, set in an earlier step. I want to pass the value of that variable into my command script as an argument. The script name is set in Execute Process Task's property Executable: C:\scripts\myscript.cmd So far so good, because I can see the script getting called.
Now for the argument. I set the Execute Process Task's property Argument to the variable: User::RowCnt. The package executes successfully, but the script reports the following as the value of the input variable: User::RowCnt. So it's passing the variable name, not the value of the variable.
So after some research, I find this SQLServerCentral article, which tells me to use an expression to set the Argument property. I set the Argument property to empty. In the Expressions property, I set the value of the Arguments property this Expression: @[User::RowCnt]. First error is in the Expression builder window:
Cannot convert expression value to property type.
------------------------------ ADDITIONAL INFORMATION:
Cannot convert 'System.Int32' to 'System.String'.
OK, I need to cast it as a String. I append the TypeCast operator in front of it: (DT_STR, 3, 1252) @[User::RowCnt]. Next error:
Expression cannot be evaluated.
------------------------------ ADDITIONAL INFORMATION:
The expression "(DT_STR, 3, 1252) @[User::RowCnt]" has a result type of "DT_STR", which cannot be converted to a supported type.
I look at the example again, and see the Expression is surrounded by quotes, so I try that:"(DT_STR, 3, 1252) @[User::RowCnt]". That passes the Expression Builder syntax checks, and the package runs without error, but the script reports the following as the value of the input variable: (DT_STR
So again the variable name is getting passed, not the value of the variable.
Let me know what other information you need (and how to provide it).
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Today @ 3:00 PM
Points: 93,
Visits: 502
|
|
Looks like this is a data typing issue. When I use the Expression (DT_WSTR, 4) @[User::RowCnt] to set the Argument property of the Execute Process Task, the value of User::RowCnt is passed into my script, and all is well.
Why would DT_WSTR work, and not DT_STR?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Saturday, February 02, 2013 8:21 AM
Points: 283,
Visits: 268
|
|
This makes sense once you think about it. SSIS is written using the .NET Framework so all "Strings" in any .NET language are treated as Unicode (WSTR). It is always a pain for me to get things into a DB as just STR (i.e. VarChar).
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, January 04, 2011 11:49 PM
Points: 6,
Visits: 34
|
|
Hi, I have a string variable which is of scope package and a .dtsconfig file which contains the value of the variable. I am using this variable in Execute process task as an argument using Evaluate expression. My question is how can I assign the variable value in dtsconfig file to variable in Package? Please help me in this. Thanks in advance.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Saturday, February 02, 2013 8:21 AM
Points: 283,
Visits: 268
|
|
Without going into too much detail, using configuration files in this manner is one of the basics and you can probably find a lot of help online or in the help files. Basically, go to Package Configurations, enable Configurations, and choose an Xml file for your config file. The Wizard kind of walks you through everything and helps you map you Config settings to your Variables.
http://vyaskn.tripod.com/sql_server_2005_making_ssis_packages_portable.htm
|
|
|
|