Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Monday, March 26, 2012

Parent Package Doesn't Recognize Child Settings

I have two issues:

I have a simple parent that uses an Execute Package Task to call a simple child package. The child package has a Data Flow that I disabled. When running the child package by itself, the data flow task is bypassed. When running the package via the parent the data flow task executes.

Second issue is when you disable the package configurations in the child, the parent doesn't recognize that it's diables and tries to load the configurations.

It's almost like there are some settings in a child that get ignored by the parent?

Anyone else experience this?

thx

My fault, pls ignore...

Wednesday, March 21, 2012

parse incoming mail content and attacthments into tables

I'm fairly new at this, so I'm not sure if this is a simple task or
not. I've only been able to find desktop applications on doing this
and that's really not the way I want to go.
What I'm trying to do is this:
We have a program that sends email in a templated format (always
containing the same info on the same lines) with a few attached files
as well. We want the server to see them come in, parse the info out of
the body of the email and insert into a few different tables. We also
want to be able to save the images into another table.
The first question I have is whether we write something that sits on
the Exchange server or on the SQL server. If on the SQL server, I
guess I'll have to figure out how to issolate one email address to
point to the SQL server.
Any ideas on where to begin?Hi
With SQL mail you can attach to the mailbox and process messages from it.
You may want to look at looping through xp_findnextmsg and calling
xp_readmail or use sp_processmail see Books Online for more information
regarding these procedures. Also check out:
http://msdn.microsoft.com/library/d...erverE-mail.asp
John
"roger@.springloose.net" wrote:

> I'm fairly new at this, so I'm not sure if this is a simple task or
> not. I've only been able to find desktop applications on doing this
> and that's really not the way I want to go.
> What I'm trying to do is this:
> We have a program that sends email in a templated format (always
> containing the same info on the same lines) with a few attached files
> as well. We want the server to see them come in, parse the info out of
> the body of the email and insert into a few different tables. We also
> want to be able to save the images into another table.
> The first question I have is whether we write something that sits on
> the Exchange server or on the SQL server. If on the SQL server, I
> guess I'll have to figure out how to issolate one email address to
> point to the SQL server.
> Any ideas on where to begin?
>

Parse comma separated string into individual rows

All,

Can anyone help me in this task? I have a table named 'Activity' which has two columns: ActivityID and ActivityDetail. Sample rows look like this:

ActivityID ActivityDetail
1 'Football','Basket ball', Tennis'
2 'Basket ball', 'Volley ball'

I would like to have a stored procedure which parses the data into a new table (e.g. named as 'Activity_breadkdown' and with an identity column named 'DetailID') and looks like this:

DetailID ActivityID ActivityDetail
1 1 Football
2 1 Basket ball
3 1 Tennis
4 2 Basket ball
5 2 Volley ball

Thanks in advance
AlYou can modify the code posted in this thread...

http://www.dbforums.com/t974750.html

Friday, March 9, 2012

Parameters in Execute SQL Task after SP2

Hi,

we have a Package, that worked fine for a long time. Now, it always fails on all computers with SP2 instaled. The problem apears in execute sql task, which uses ole db connection manager and calls a procedure with some input parameters (from sql server).

Package sends a undesirable data (".") into the procedure from variable, which has NULL or Empty string value. Originaly, data type of the Variable was Object, I tried to use also string, but in both cases the procedure was called with parameter "."

Please, can anybody tell me what's wrong?

Thanks

Janca

Do you have output parameters in your stored procedure?

In SP2 there was a change to the way stored procedures with output parameters are executed. Earlier there was no way to specify the parameter size and hence we were defaulting to the behavior of each provider when output parameters are involved. In SP2, you could specify the parameter size for the output paramters of variable length data types. Even this change should not break existing packages since the default value of the parameter is -1 should provider the pre-SP2 behavior.

If you can share the values of different properties on your execute sql task, we can take a look and see what is wrong with it?

|||I have a similar issue in SP2. I have a variable V1 (string) which I reference in the ParameterMapping of an Exec SQL Task. The Exec Sql Task uses an OLEDB connection manager to SqlServer 2005. In the parameter mapping I specify VARCHAR and parameter size = -1. The Sql Statement executes a stored proc with one INPUT parameter @.P1 VARCHAR(500). In the proc I test the length of @.P1. If I leave the SSIS variable V1 empty, when I exec the proc it says @.P1 is length = 1. I would expect the length to be zero. The value seems to be the ASCII NUL value (0). How can I get it to be an empty string as I would expect it to be? Thanks.

Parameters in data flow task with Oracle database source

In many DTS packages I have used parameterised queries for incremental loads from Oracle database sources using the Microsoft ODBC Driver for Oracle.

Now I want to migrate these packages to SSIS, but the OLE DB connection for Oracle does not support parameters.

I cannot use the "SQL command from variable" data access mode because of the 4000 character limitation on the length of string variables and expressions.

Am I missing an obvious workaround?

pshotts wrote:

In many DTS packages I have used parameterised queries for incremental loads from Oracle database sources using the Microsoft ODBC Driver for Oracle.

Now I want to migrate these packages to SSIS, but the OLE DB connection for Oracle does not support parameters.

I cannot use the "SQL command from variable" data access mode because of the 4000 character limitation on the length of string variables and expressions.

Am I missing an obvious workaround?

below is workaround, but i don't know how "obvious" it is:

Use property expressions. The SQL statement you use to query the Oracle source can be set by a variable, and that variable can be composed using a property expression such as: "select * from Orders where OrderID > " + @.LastOrderID. It's a parameterized query - and a very flexible one - in all but name.

|||Thanks Duane, but that does not get around the 4000 character limit on variable and expression length|||

Can you use a combination of query strings (in SSIS) and views in Oracle to reduce the amount of work you are doing in the one string?

Another alternative might be to execute a stored procedure that builds a temporary table (passing the parameters to the procedure), then read from the temporary table.

A third alternative would be to pull back the various discrete data sources from Oracle and handle joining/merging within SSIS. Can't say I'd recommend this one though. Better to just pull across the data you need from the remote source.

|||

Another option is to use a script source in which you concatenate the query string and call Oracle using OLEDB or ADO.Net in the script.

Donald

|||

Thanks Donald

That sounds like a good option. I understand that you mean we should use a Script Component as the Source in the Data Flow. The script will make the connection and build and run the required query.

Nice!

|||

That's correct.

You can still use a connection manager with your script component, to take advantage of that feature, but even that is not essential. although recommended.

Donald

Wednesday, March 7, 2012

Parameters for Lookup Transformation Query!

Hi Gurus,

I have a Dataflow Task which has an OLE DB Source calling a SP with parameters (?, ?). Then this OLE DB Source is conencted to a Lookup Transform which also calls a SP but on a different database. I am unable to figure out how to pass parameters in a Look up Transform.

In the 'Use Results of an SQL Query' pane of Lookup Transform:

Code Snippet

EXEC GetMonthlyDataExtract 4, 2007

( I am passing month and year values) this works ok.

But when I chage to

Code Snippet

EXEC GetMonthlyDataExtract ?, ?

It says EXEC not supported. Also I can not figure out how to configure parameters since 'Reference Table' Tab of the Lookup Transform does not have any option where we can attach variables to parameters.

Also I am interested to map parameters to variables not to input columns.

If mention if that is not possible or any other alternative.

Your help will be appreciated.

Thanks,

Paraclete

It's a bit of a workaround, but I think you could put your variables in data columns and then use the Lookup in partially cached mode. Go over to the Advanced tab, check Enable Memory Restriction, Enable Caching, and Modify SQL Statement. Put your parameterized EXEC in the statment and set the parameters based on your variable/columns. Instead of executing your procedure in the PreExecute phase, now it will get executed on the first row. Since you're caching the results, the procedure should never get executed again. So it's effectively the same functionality.

Update:
On second thought, the Lookup workaround described here probably won't work. When the Lookup is in partial cache mode, it doesn't perform its own matching, but relies on the modified query and the database engine to perform the matching. Since the parameters to your procedure are not the columns you want to match on, the Lookup won't return the correct matching row.


You may also consider using the Merge Join instead of Lookup.