Showing posts with label tasks. Show all posts
Showing posts with label tasks. Show all posts

Friday, March 9, 2012

Help - Tasks that have circular dependencies

Hello,

I have a package, which calls a sub package to poulate a table depending on a flag in the database (using an ExecuteSQL task to return flagged table name).

The inner package populates some tables, and calculates what needs to be processed next. It sets the next flag.

However, I can't make this work in the control flow, as once the Execute package has completed, I need to start again from the top, as the flag will have changed to the next item.

I hope that I have explained this well enough.

I really need this to work, but SSIS will not let me create a circular dependency. Does anyone know a way around this, or can offer me an alternative solution?

I am getting desperate, so any suggestions will be welcome

Many thanks

The Foreach Loop Container may be of use. have you evaluated that?

Regards

-Jamie

|||

Hello Jamie,

Thanks for the reply.

Yes, I have, but as I have to pass it a recordset at the start of the for each.. it doesn't seem to fit the bill. I have to pick up these tables in an order only defined at run time by the sub package.

|||The Foreach container is exactly what you need to use. You will need to store your recordset in a user variable using an ExecuteSQL task and then use the Foreach container with a Foreach ADO enumerator. More direction is available on BOL but that should be enough to get you started.|||

Oh dear,

I am not explaining this very well, I;m sorry.

On the first pass I will get a table name from ny ontrol table which beeds to be populated. Once this is populated, I will mark the parent tables next to be processed in my control table.

So on the second iteration, I need to retrieve a new recordset to pass to the For Each loop. And so on.

Sorry if I am being obtuse, but I can't see how I can make this work.

Monday, February 27, 2012

Help -- How do I exit a Foreach Loop

I have a foreach loop that is processing files in a directory. One of the tasks is the execute sql task that calls a stored proc. If this stored proc returns a certain value then I need to exit the loop and not process any more files. But I have been unable to figure out how to make this happen.

Any help would be greatly appreciated.

Thanks!

GN

Hi,

I am not sure whether this will work or not. But just try. In the 'Foreach loop' container, select 'Expressions' tab and assign a boolean variable to the propery 'Disable'. Then based on the result, when required, set the value of the variable to 'True'. If it does not work, try this option for 'ForceExectionResult' also.

Let me know if any one of it works.

|||

GN wrote:

I have a foreach loop that is processing files in a directory. One of the tasks is the execute sql task that calls a stored proc. If this stored proc returns a certain value then I need to exit the loop and not process any more files. But I have been unable to figure out how to make this happen.

Any help would be greatly appreciated.

Thanks!

GN

have you considered using the script task instead?|||

Place the workflow in a sequence inside the ForEach Loop.

Place a script task at the beginning of the loop with a precedence constraint going to the sequence.

Place an expression on the precedence constraint to only execute if a variable is true, call the variable, "ExecuteBody". ExecuteBody==true

Set op to expression only

When the loop should terminate, set the ExecuteBody variable to false. The loop will traverse the entire remaining collection, but because there is nothing to execute, it will rip through it extremely fast and terminate.

K

Sunday, February 19, 2012

Help

You are the administrator of a SQL Server 2000 computer. Each
evening after business hours, you perform database maintenance tasks. You
create a data transformation services package to populate the data
warehouse. MAPI is not installed on the server. You want to schedule the DTS
package to run each night. You want to attend to other duties while the DTS
package is executing. You also want to be notified if the DTS package fails.
What should you do?
A. Select the 'DTS packages log package execution to SQL
Server' check box. Create a SQL Server event alert to notify you if the
package fails.
B. Select the 'DTS packages write completion status to
event log' check box. Create a SQL Server event alert to notify you if the
package fails.
C. Configure the DTS package to include an on failure
precedence constraint and a send mail task. Configure the send mail task to
notify you if the package fails.
D. Configure the DTS package to include an on failure
precedence constraint and a send mail task. Configure the execute process
task to execute a not send command that will notify you if the package
fails.
Hi,
I will go with B option. In this option you could alert an email incase of
failure.
Thanks
Hari
MCDBA
"Noor" <noor@.ngsol.com> wrote in message
news:O8JNpQ5eEHA.2896@.TK2MSFTNGP11.phx.gbl...
> You are the administrator of a SQL Server 2000 computer. Each
> evening after business hours, you perform database maintenance tasks. You
> create a data transformation services package to populate the data
> warehouse. MAPI is not installed on the server. You want to schedule the
DTS
> package to run each night. You want to attend to other duties while the
DTS
> package is executing. You also want to be notified if the DTS package
fails.
> What should you do?
>
> A. Select the 'DTS packages log package execution to SQL
> Server' check box. Create a SQL Server event alert to notify you if the
> package fails.
> B. Select the 'DTS packages write completion status to
> event log' check box. Create a SQL Server event alert to notify you if the
> package fails.
> C. Configure the DTS package to include an on failure
> precedence constraint and a send mail task. Configure the send mail task
to
> notify you if the package fails.
> D. Configure the DTS package to include an on failure
> precedence constraint and a send mail task. Configure the execute process
> task to execute a not send command that will notify you if the package
> fails.
>
>
|||What about Option D , Net Send Command ?
Thanks
NOOR
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:#xvVx5WfEHA.708@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Hi,
> I will go with B option. In this option you could alert an email incase of
> failure.
> Thanks
> Hari
> MCDBA
>
> "Noor" <noor@.ngsol.com> wrote in message
> news:O8JNpQ5eEHA.2896@.TK2MSFTNGP11.phx.gbl...
You[vbcol=seagreen]
> DTS
> DTS
> fails.
SQL[vbcol=seagreen]
the[vbcol=seagreen]
> to
process
>