SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Is Not Just for SQL Server


SSIS Is Not Just for SQL Server

Author
Message
Charles Kincaid
Charles Kincaid
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4909 Visits: 2384
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.

ATBCharles Kincaid
stevemc
stevemc
Old Hand
Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)

Group: General Forum Members
Points: 339 Visits: 699
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?
tymberwyld
tymberwyld
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2808 Visits: 275
Can you include a brief code snippet, I can't really understand what you're doing to pass the variable.



stevemc
stevemc
Old Hand
Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)

Group: General Forum Members
Points: 339 Visits: 699
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).
stevemc
stevemc
Old Hand
Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)Old Hand (339 reputation)

Group: General Forum Members
Points: 339 Visits: 699
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?
tymberwyld
tymberwyld
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2808 Visits: 275
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).



umamahesh-951427
umamahesh-951427
SSC-Enthusiastic
SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)SSC-Enthusiastic (186 reputation)

Group: General Forum Members
Points: 186 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.
tymberwyld
tymberwyld
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2808 Visits: 275
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



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search