Showing posts with label loop. Show all posts
Showing posts with label loop. Show all posts

Monday, March 26, 2012

Help --FOr Each Loop Container (For each file Enumerator) SSIS package

Can anyone help me with FOr Each Loop Container (For each file
Enumerator) control flow SSIS package
If I use FOr Each Loop Container (For each file Enumerator), it will
select all the files in that folder. What if I want to select just 100
files (assuming 500 files in the folder)
How do i do this?
Thanks
Hi
I am not a SSIS expert, but a for loop can be used with a counter
http://www.sqlis.com/default.aspx?310 but I am not sure how this could be
done with a foreach loop. I guess you could have an activeX task that checks
a variable and returns failure when the counter is exceeded or increments it
and returns success when not.
John
"Vishal" wrote:

> Can anyone help me with FOr Each Loop Container (For each file
> Enumerator) control flow SSIS package
> If I use FOr Each Loop Container (For each file Enumerator), it will
> select all the files in that folder. What if I want to select just 100
> files (assuming 500 files in the folder)
> How do i do this?
> Thanks
>

Help --FOr Each Loop Container (For each file Enumerator) SSIS package

Can anyone help me with FOr Each Loop Container (For each file
Enumerator) control flow SSIS package
If I use FOr Each Loop Container (For each file Enumerator), it will
select all the files in that folder. What if I want to select just 100
files (assuming 500 files in the folder)
How do i do this'
ThanksHi
I am not a SSIS expert, but a for loop can be used with a counter
http://www.sqlis.com/default.aspx?310 but I am not sure how this could be
done with a foreach loop. I guess you could have an activeX task that checks
a variable and returns failure when the counter is exceeded or increments it
and returns success when not.
John
"Vishal" wrote:
> Can anyone help me with FOr Each Loop Container (For each file
> Enumerator) control flow SSIS package
> If I use FOr Each Loop Container (For each file Enumerator), it will
> select all the files in that folder. What if I want to select just 100
> files (assuming 500 files in the folder)
> How do i do this'
> Thanks
>

Wednesday, March 21, 2012

Help batch script task stuck in a loop

I have a .bat file that calls a script file to log in to a server and upload a file to my pub account. When I run the .bat file it just executes the command over and over and never executes the script file. Does anyone know why? Am I missing something in my script or .bat file commands below?

my .bat file contains this>ftp -s:script.txt

my script file contains this:

open myserver.com
username
password
put W:\UPLOAD\doc.txt
bye
exit

Thanks,

Mike

Looping doesn't seem reminiscent of the batch file or the script you have listed here. I sounds like it may be due to some logic in your package. Any chance this is happening in your package?|||

It works now.

|||

Mike,

I have the same problem, can you post the solution?

Thanks.

Sebastian.

|||

Instead of using the batch file, I used a ftp script and called it using the Execute Process Task Editor:

Executable: C:\WINDOWS\system32\ftp.exe

Arguments: -s:"C:\Documents and Settings\me\Desktop\SQL 2005 DMS project-Prod\Download E-Apps\ftpscript.txt"

the ftpscript.txt file contains the following:

open hostname
me
password
Ascii
put filepath\name
bye
exit

sql

Help batch script task stuck in a loop

I have a .bat file that calls a script file to log in to a server and upload a file to my pub account. When I run the .bat file it just executes the command over and over and never executes the script file. Does anyone know why? Am I missing something in my script or .bat file commands below?

my .bat file contains this>ftp -s:script.txt

my script file contains this:

open myserver.com
username
password
put W:\UPLOAD\doc.txt
bye
exit

Thanks,

Mike

Looping doesn't seem reminiscent of the batch file or the script you have listed here. I sounds like it may be due to some logic in your package. Any chance this is happening in your package?|||

It works now.

|||

Mike,

I have the same problem, can you post the solution?

Thanks.

Sebastian.

|||

Instead of using the batch file, I used a ftp script and called it using the Execute Process Task Editor:

Executable: C:\WINDOWS\system32\ftp.exe

Arguments: -s:"C:\Documents and Settings\me\Desktop\SQL 2005 DMS project-Prod\Download E-Apps\ftpscript.txt"

the ftpscript.txt file contains the following:

open hostname
me
password
Ascii
put filepath\name
bye
exit

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

Friday, February 24, 2012

HELP - ActiveX stuck in loop, cannot kill!

Someone please help--

I've been working on an ActiveX script in a DTS package. I executed the script and it's stuck in a while..wend loop. If I kill it I will lose all the code I wrote (pretty much a lot) since last saving the entire package.

Is it possible either:

a) Kill the activex step without killing the entire DTS designer session.
b) Locate the ActiveX code which must be in a temp table somewhere.

Please help I don't want to recode the entire object.

Thanks!If you kill the spid when eunning a query in qa it doesn't shut qa...

Now don't take my word for it, but maybe if you kill the spid, the designer session will still be open...

BUT WHY would you run something before saving and WHY would you have a loop of any kind?