Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

SSIS Is Not Just for SQL Server Expand / Collapse
Author
Message
Posted Wednesday, June 11, 2008 12:07 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, February 6, 2014 12:59 PM
Points: 801, Visits: 1,962
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

Post #515420
Posted Thursday, July 3, 2008 5:48 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 7:44 PM
Points: 94, Visits: 565
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?

Post #528439
Posted Saturday, July 5, 2008 7:04 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Saturday, February 2, 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.


Post #528831
Posted Monday, July 7, 2008 9:43 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 7:44 PM
Points: 94, Visits: 565
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).
Post #529428
Posted Monday, July 7, 2008 1:13 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 7:44 PM
Points: 94, Visits: 565
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?
Post #529582
Posted Tuesday, July 8, 2008 4:10 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Saturday, February 2, 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).


Post #529858
Posted Wednesday, December 24, 2008 2:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, January 4, 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.
Post #625238
Posted Wednesday, December 24, 2008 6:44 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Saturday, February 2, 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



Post #625339
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse