Slow Web Service Task In Foreach Loop

May 9, 2008



Hi I have created a web service task that sits inside of a foreach loop. The loop is a ado enumerator. This loop is going to loop through about 35,000 records and make 35,000 web service calls.

So far through my testing, I have gotten it to read and write everything correctly, but each call to the web service takes about 1-2 seconds and maxes out the CPU. This would take almost all day for this web service to run at 100% CPU power all day. We want to be able to run this a few times a day or at least once a day.

I have disabled all of the other tasks in the foreach loop so it just calls the web service task and found that it's the web service task that takes up 100% of the CPU and takes 1-2 seconds to run. I have also tried creating a mock web service on the server that just sends back the same mock data, so it's extremely fast, but the Web Service Task still maxes out the CPU and takes 1-2 seconds per call.

I have tried this out on 2 different servers, all with a few gigs of ram they're not using. It seems more like it's a CPU thing, or that the Web Service Task has a high overhead that each time in the loop it takes 1-2 seconds to create the task.

Anyone have any advice?

Thanks,
-Will

View 6 Replies


ADVERTISEMENT

Send Mail Task Problem Using A Combination Of ForEach Loop, Recordset Destination, Execute SQL Task And Script Task

Jun 21, 2007

OK. I give up and need help. Hopefully it's something minor ...



I have a dataflow which returns email addresses to a recordset.

I pass this recordset into a ForEachLoop configuring the enumerator as (Foreach ADO Enumerator). I also map the email address as a variable with index 0.



I then have a Execute SQL task which receives this email address as a varchar variable (parameter 0) which I then use in my SQL command to limit the rows returned. I have commented out the where clause and returned all rows regardless of email address to try to troubleshoot this problem. In either event, I then use a resultset to store the query result of type object and result name 0.



I then pass this resultset into a script variable to start parsing the sql rows returned as type object. ( I assume this is the correct way to do this from other prior posts ...).



The script appears to throw an exception at the following line. I assume it's because I'm either not passing in the values properly or the query doesn't return anything. However, I am certain the query works as it executes just fine at the command prompt.



Try

ds = CType(Dts.Variables("VP_EMAIL_RESULTS_RS").Value, DataSet)



My intent is to email the query results to each email address with the following type of data by passing the parsed data from the script to a send mail task. Email works fine and sends out messages but the content is empty. I pass the parsed data as string values to the messagesource and define the messagesourcetype as a variable in the mail task.



part number leadtime

x 5

y 9

....



Does anyone have any idea what I might be doing wrong?

thanks

John

View 5 Replies View Related

ForEach Loop Container And First Task

Nov 8, 2006

Hi,

My Foreach Loop container has 10 different task inside. I want to execute the first task only one time. I have a variable with increases for each repition. How can I put precedence contstraint on the first task so that it should execute only first time and other task has to execute all the time.

Thanks

View 4 Replies View Related

Insert Failure While Using ForEach Loop + Execute SQL Task.

Sep 10, 2007

Hello All

I was trying to insert some row from one table to another of different database.
I was using Execute SQL task along with Foreach loop container.

In my execute SQL task I am using this query


SET IDENTITY_INSERT dbo.Table1 ON

INSERT INTO dbo.Table1

SELECT * FROM DB2.dbo.Table2
WHERE TableKey = ?

When executed I get this error:
failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

While the same query when executed in Management Studio Its successful.

The properties I set

For Each Loop Editor Settings:
1) Collection: a) Enumerator Set to ForEach ADO Enumerator
b) ADO Object Source Variable: User:bjectVariablename
c) Checked Rows in the first table
2) Variable Mapping: New Int Variable2 and Index = 0 to set it to first colunm.
3) Expression: Left blank

Execute SQL Task Editor:
1) General: a) Timeout : 0
b) CodePage: 1252
c) Result Set: None
d) SQLSourceType: Directinput
e) SQL Statement: SET IDENTITY_INSERT dbo.Table1 ON INSERT INTO dbo.Table1 SELECT * FROM DB2.dbo.Table2 WHERE TableKey = ?
f) BypassPrepare: False
2)Parameter Mapping: Variable Name : New Integer variable2 selected
Direction: Input
DataType: Long
ParameterName: 0


Can somebody help me in this regards.




Reference:
a) http://www.whiteknighttechnology.com/cs/blogs/brian_knight/archive/2006/03/03/126.aspx



View 10 Replies View Related

Problem With Bulk Insert Task In Foreach Loop

Dec 18, 2007

Hi Guys
The problem is...
When i try to bulk insert a single file its working fine. When i want to loop a set of files in a folder and use Foreach Loop and BulkInsert Task...its failing..

In the flat file connection When i specify usage type as existing file...its loading the same file "n" number of times where n is the number of files in the folder.

When i select usage type as existing folder i get error " Cannot bulk load because the file "....folder" could not be opened. Can someone help me out with this?
I have sql 2005 as as separate instance...beside my 2000 which is default

Thanks!

View 9 Replies View Related

XML Task Inside Foreach Loop Container Had To Fail!!!

Aug 9, 2007



Hi,

I am using an XML task for validating the XML data against the Schema XSD. I have more XML Files with same the schema. I have to used a for loop container which has an XML task for validate XML. The loop container gets the XML File into variables name "XMLFileName" which the loop current file, in turn, used by XML Task for validation.

XML task is configured in the option "Validate". I have provided the XML Data in variable name "XMLFileName" also get the name from the loop container and XSD file content File Connection. XML Task stored the result in the another variable name "OKFormat". FailOnValidationFail property set to false.

It had the error when I run the package, the error msg as below:


Error: 0xC002F304 at XML Task, XML Task: An error occurred with the following error message: "Data at the root level is invalid. Line 1, position 1.".

Error: 0xC002928F at XML Task, XML Task: Property "New Source" has no source Xml text; Xml Text is either invalid, null or empty string.

Task failed: XML Task

After that, I had to change the source type from Variable to File Connection, and had to test fixed to some xml file it had ok for validate the XML file againt XSD.

I don't know this is the wrong setting or bug of SSIS, anyone can guide me through.

View 7 Replies View Related

Articles On Foreach Loop Container Over Dataflow Task?

Nov 3, 2006

Hi everyone,

do you know any articles on foreach loop container that loops over a dataflow task...pls tell me....

thanks in advance,

View 2 Replies View Related

Capture Files With ForEach Loop And Execute Sql Task

Feb 27, 2008

Hi all,

I'm trying to capture the file name and insert to the Database with Loop Container and Execute Sql task...However when I run, I get error with the input parameter.

In my Sql Task, the parameter mapping:
Variable name: user::variable,
direction: input,
Data Type: Varchar,
parameter name: @xVariable,
parameter size: -1

connectiontype: OleDB
sourcetype: direct input
statement : insert into xtable(xcolumn) values(@xVariable)

Anyone have any other suggestion how to capture the filename and input in the database?

thanks

View 4 Replies View Related

Execute Process Task To Unzip In Foreach Loop

Jan 8, 2008

Hi,



I am trying to use SSIS.Execute Process Task within Foreach loop . The task should unzip a a variable gzip file provided to it from the previous task

to execute the command from cmd C:Program FilesGnuWin32ingzip.exe -d -k c:folderfilename
My input in the Execute Process Task as follow:

The command line: C:Program FilesGnuWin32ingzip.exe

Argument: -d -k c:folder

Variable: User::var_filename
keep getting error

The process exit code was "1" while the expected was "0".
Thanks

View 3 Replies View Related

Foreach Loop Xmla Analysis Services Execute Ddl Task

Mar 21, 2007

Hi:

I am a R data miner who is new to SQL and SSIS and would appreciate any help.

I wanted to automate the process of creating and processing decision tree models for every county in the Country. I wanted to use the foreach loop for iterate through all the counties. I wanted the foreach enumerator to be used by the XMLA code that creates the model so it would append it to the name of the model and i would get a different model for every county. I am not sure how to have the XMLA code accept foreach loop enumerator.

Any help would be greatly appreciated and if you could direct me to a previously done example that would greatly benefit me.

Thank you
avneet

View 1 Replies View Related

Dynamically Changing Task Name Displayed Within ForEach Loop Container

Oct 27, 2006

Does anyone know how to change the task name displayed within a ForEach Loop Container (or of the ForEach Loop Container task itself) based on a variable. I am pretty familiar with setting variable values during task execution and using expressions to alter task properties based on variables. I have tried using an expression to alter the value of the Name property of the ForEach Loop Container but the name of the ForEach Loop Container does not change during execution. Since the color of the various tasks change during execution, I would think that the task names could be changed as well.

View 7 Replies View Related

Using User Defined Function In Execute SQL Task Within Foreach Loop

Jul 19, 2007

hi



I am trying to execute a UDF in an Execute SQL Task within a Foreach loop.

I have an Execute SQL task to get the dataset (Firstname, Lastname, CompanyID) which is going into a full result set called @PendingPar. The Foreach Loop is set to a Foreach ADO Enumerator against @PendingPar and I have created 3 variables at the Foreach Loop scope level called @Firstname (String), @Lastname (String) and @CompanyID (Int32). These are mapped in the Foreach Loop as index 0,1 and 2.



Within the Foreach Loop I have an Execute SQL Task with the sql command



select dbo.udf_GetParTitle (?,?,?)



In the parameter mapping I have Variable Name = User::Firstname Direction = Input Data Type = VARCHAR and Parameter Name = 0, User::Lastname, Input, VARCHAR, 1 and User::CompanyID, Input, VARCHAR,2



Finally the UDF returns a @NewPar value so i have the result set in the execute sql task to Single Row which goes into variable @NewPar. This @newPar will be used later but I cannot get the first bit to work yet.



the error message i get back is



Error: 0xC002F210 at Execute SQL Task 1, Execute SQL Task: Executing the query "select dbo.udf_GetParTitle (?,?,?)

" failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Task failed: Execute SQL Task 1



the initial execute sql task where the dataset is selected works fine but it is within the foreach loop that it fails.



any help gratefully recieved



View 6 Replies View Related

Foreach Loop, Data Flow Task Buffer Failed

Jun 5, 2006

I have a package that runs fine by itself. But when I run it inside a Foreach Loop container on a parent package, I got a buffer error after a few loops. Here are a couple of the error lines:

A buffer failed while allocating 49085616 bytes.

The attempt to add a row to the Data Flow task buffer failed with error code 0x8007000E.

I already played around with the Data Flow task€™s DefaultBufferMaxRows and DefaultBufferSize properties, and I am still getting the error. Just wondering if there is a memory leak or something with the Foreach Loop task. I haven€™t install SP1. Maybe SP1 fixes this issue?

View 3 Replies View Related

Foreach ADO Enumerator Calling Web Service Task?

Mar 1, 2008

Hi: I a SSIS beginner and am hoping this is an easy one. I am using a Foreach loop container with an in-memory ADO recordset as the enumerator. The recordset has 3 columns and one of them I wish to fixup data in by calling a web service task that returns an integer. I see how to call the web service and return the integer into a variable but am unsure how to approach putting that variable back into the in-memory ADO recordset? Should I even be trying to do it this way?
thanks!
Henry

View 11 Replies View Related

Getting Access Denied To FileName Error When Using The Execute Sql Task (With File Connection) Into A Foreach Loop Container.

Jan 18, 2007

Hi ALL,

Getting Access Denied To FileName Error When Using the Execute Sql Task (With File Connection) into a Foreach Loop Container.

Please Note :

I have a folder containing .sql files. I have to dynamically loop through the files and send them as a File connection Folder to the Execute Sql Task.

When I run this Package I am getting the follwoing error :

[Execute SQL Task] Error: An error occurred with the following error message: "Access to the path 'C:ProjectsFuzzy Lookup DataFlow ExampleScripts' is denied.".

Also I have logged in to the machine as Administrator and to Sql Server with sa.

Please help.



Thanks.

Regards,

Salil

View 1 Replies View Related

Foreach Loop Container Foreach File Enumerator Sort Files

Apr 4, 2007



How do you sort files from the Foreach loop container?

I love this component, except I can't get it to sort by filename.

Nice to know how to sort by timestamps also.



Dave

View 27 Replies View Related

Foreach Loop Container - Foreach ADO Enumerator How Performance Compares To Use Of Cursors In Stored Procs

Apr 22, 2008



Hello

I have a question

How is foreach loop container - foreach ADO enumerator performace in SSIS package compares to use of cursors in stored procedures

Is there any articles comparing them

I understand a lot of factors can affect the performance, however what is expected performance for the foreach ADO enumerator loop for large dataset. What is Microsoft recommendation for that - recommended - not recommended (using large datasets - over million records)

Thank you
Arminr Bell

View 4 Replies View Related

Foreach File Enumerator - Is Absent In Foreach Loop Component

Apr 11, 2007

Hi,

I have no "Foreach File Enumerator" oprtion in the Enumerator Property of the Foreach Loop Component.

I have this enumerator in the c:Program FilesMicrosoft SQL Server90DTSForEachEnumerators folder.

Also I check it in the GAC - it does not here. I try to execute gacutil.exe -iF ForEachFileEnumerator.dll, but it is failed with "Failure adding assembly to the cache: The module was expected to contain an assembly manifest." Seems it is not managed enumerator.



Please help me.

Also information on how to regeister unmanaged enumerators are welcome!

View 3 Replies View Related

SQL Server 2008 :: Difference Between FOR LOOP And FOREACH LOOP?

May 28, 2010

difference between FOR LOOP and FOREACH LOOP with example(if possible) in SSIS.

View 4 Replies View Related

Foreach Loop Doesn't Loop

Mar 3, 2006

I have a foreach loop that is supposed to loop through a recordset, however it doesn't loop. It just repeats the same row, row after row.

I would like to look into the recordset variable but I can't because it is a COM object and the ADODB namespace is not available in the script task.

Any solution to this? anyone experienced anything similar

View 1 Replies View Related

Foreach Loop?

Jul 10, 2006

I need to execute about dozen packages from another package... how do I dynamically pass the dozen package names to the package and execute using foreach loop...?

idea is to store the names of packages in a text file and set the file connection property reading each package names from the text file... in this way I can just configure/edit the text file from time to time, the packages and the units that I want to execute...

Someone please provide me steps to make it work.

Thanks in adv.

View 4 Replies View Related

For/Foreach Loop

Jun 10, 2007

Hi,



I'm looping through some query data and doing a Script Task check inside the loop on a datetime field.



If the datetime happens before 10 o'clock:

- Store the data row in Table1

If the datetime happens after 10 o'clock:

- Store the data row in Table2



How can I store the datarow inside the loop without inserting it into a database table?

I need to access the data in the next step after the loop. How can I do this?



Thank you very much!



View 4 Replies View Related

SP Not Firing In Foreach Loop

Feb 28, 2008

The foreach loop below runs fine and it sends emails as expected but the SP does not update the Companies table.  Any thoughts?  How do I cause the SP to execute?  
 PROCEDURE newdawn.EmailSentDate      @CID intAS     UPDATE Companies      SET Companies.LastEmailDate = (GetDate())     WHERE tblCompanies.C_ID = @CID RETURN
foreach (GridViewRow row in GridView3.Rows)        {            pstrTo = row.Cells[2].Text;            CEmail = row.Cells[2].Text;            CName = row.Cells[3].Text;            CID = row.Cells[1].Text;            CState = TextBox1.Text;            CCity = row.Cells[5].Text;            CCat = row.Cells[4].Text;            CCID = row.Cells[0].Text;
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["localhomeexpoConnectionString2"].ConnectionString);            SqlCommand cmd = new SqlCommand("EmailSentDate", con);            cmd.CommandType = CommandType.StoredProcedure;            cmd.Parameters.AddWithValue("@CID", CCID);                                    try            {                System.String mailServerName = "mail.domain.com";
                               REST of code sends email to email address found in each row ....it all works find but SP above does not fire.
 

View 12 Replies View Related

Foreach Loop Container

Jan 22, 2008

Hello Experts,

Sorry that I open a new thread again but I didn€™t found any good tutorials about foreach loop container. I would like to read every row from one table and do something.
I red something about sql task€¦ Can someone give a little instruction, please?

Kind regards,
Alex

View 3 Replies View Related

Using Foreach Loop Container

Feb 15, 2007

Hi



I using data flow task to import from flat file to database but i need to use Foreach Loop Container to import multiple files in specific folder and all will be insert in the same table



tahnks & Regards



View 1 Replies View Related

Doing An Insert In A ForEach Loop

Feb 27, 2008


Help with Looping in a SSIS Package
Scenario:
We have a web app that lets our existing clients insert new locations into a table (Clients) in a SQL Server DB. This table has an Identity column as the PK. This table also has another ID field HBID that is the PK for another table (HLocation) in another Database system (Sybase). The HBID field is given a Default value of €˜1€™ during an insert operation in our (SQL Server) table, Clients. The Sybase database uses a Sequence table for inserting a PK into the table. Whenever our clients insert a new record in Clients (SQL Server), I need to generate a new HBID from the Sequence table in (Sybase), update the HBID in the Clients table (SQL Server) and then finally insert the record with the new HBID into table HLocation (Sybase).
I have devised a SSIS package for this as following: Note all variables are scoped at the Package Level.
Execute SQL Task #1 that drives a For Each Loop with the following properties:
General:
Connection Type: OLE DB
Connection: SQL Server DB
SQL SourceType: Direct Input
SQLStatement:
SELECT COID, HBID, Name, DateCreated
FROM Client
WHERE HBID = '1'

ResultSet: = Full Resultset

Result Set:
Result Name = 0
VariableName = USER::rsClient Variable Type = Object

ForEachLoop with the follwing properties:

Collection:
Foreach ADO Enumerator
ADO Object Source Variable = USER::rsClient
Enumeration Mode = Rows in first table
Variable Mappings:
Variable: Index:
COID 0
HBID 1
Name 2
DateCreated 3

Inside of the ForEachLoop I have another Execute SQL Task to generate a new HBID from Sybase set up as following.

Execute SQL Task #2

Connection Type: OLE DB
Connection: Sybase
SQL SourceType: Direct Input
SQLStatement:
UPDATE Autoinc SET INC_LAST = (INC_LAST+1) WHERE INC_KEY ='HBID';
SELECT INC_LAST AS NewHBID FROM Autoinc WHERE INC_KEY ='HBID'

ResultSet = SingleRow

Result Set:
Result Name = NewHBID
VariableName = USER::NewHBID, VariableType = Int32

Also Inside the ForEachLoop is a Script Task that has all of my variables as ReadWrite = COID, HBID, Name, DateCreated and NewHBID. I concatenate the values in a string a pass the string into a Message Box to make sure they are looping correctly and they are.For example the results might look like the following:

12698, 1, John Doe Trucking, 10/1/2007, 14550
13974, 1, Joe Smith Trucking, 10/1/2007, 14551
10542, 1, Dave Jones Trucking, 10/1/2007, 14552
Etc.

The values 14550 -14552 are the new HBID being generated in the loop.

The problem is that when I try to Update the HBID in the Client table (SQL Server) with another Execute SQL Task I keep getting the same NewHBID number.
In this case 14550 would be updated for every record instead of the next number in the loop.

I have set up Execute SQL Task #3 as follows:

General:
Connection Type: OLE DB
Connection: SQL Server DB
SQL SourceType: Direct Input
SQLStatement:
UPDATE Client
SET HBID = ?
WHERE HBID = '1'(SELECT COID, HBID, Name, DateCreated FROM Client)

ResultSet: = Full ResultSet

Result Set:
Result Name = 0
VariableName = USER::rsNewClient, VariableType = Object

Parameter Mapping:
VariableName USER::NewHBID, Direction = INPUT, DataType = Long
ParameterName = 0

I€™ve tried putting Execute SQL Task #3 inside of the ForEachLoop, connecting it to the output of the ForEachLoop. I€™ve tried setting up a dataflow with a Derived Column using the USER::NewHBID as the Expression.

I still get the same results, 14550 added to every row.

Can any one help or shed some light?

Any and all suggestion will be deeply appreciated!

Thanks !!!

View 1 Replies View Related

Foreach Loop - Value Back To 0

Jun 14, 2007

Hi,



Let's say you have a Data Flow Task that connects to a Foreach Loop, looping through the data.



Somewhere inside the Foreach Loop, you set an int variable MyInt to a value.



My question:

Is it possable when each iteration begins to set MyInt to 0?



Thanks in advance.

View 4 Replies View Related

Foreach Endless Loop

Feb 28, 2007

I'm having a problem where I'm using a Execute SQL Task to retrieve a dataset and storing that in an object variable. Then on success of that execute sql task I use a foreach loop task to go through the dataset and do 2 tasks inside the foreach loop. When I execute this package I have ~12 records in the dataset however when I get to the foreach loop in the 2nd iteration it keeps repeating it. It acts like it is stuck on the second record (tuple) and never goes on. I'm using an ForEach ADO Enumerator in the foreach. I've even set a breakpoint on each iteration and no task fails in side the foreach loop. I'm completely perplexed why it will iterate to the 2nd record but get stuck there in an endless loop. I've tried this on 2 different computers (with different data values) and the same thing happens. Does anyone have any suggestions?

View 40 Replies View Related

Issues About Foreach Loop

Oct 10, 2006

I defined Foreach File Enumerator,there are more than 2 files needed to deal with,it donesn't work if i don't specify filename in flat file connection manager editor,however if i specify filename then doesn't foreach files

what should i do? thanks

View 4 Replies View Related

ForEach Loop Editor

Oct 9, 2006

Help,

Trying to through a process together and using the "ForEach Loop" task. When configuring the task and using the ForEach Loop Editor I do not have the "ForEach File Enumerator" in the drop down. Anyone know whats going on or what I need to do to make this appear. I only see 5 selections: ADO, ADO.Net Schema Rowset, Variable, NodeList, and SMO Enumerators. I am also using the SQL 2005 eval with SP1.

Thanks,

John

View 2 Replies View Related

Foreach Loop Issue

Jan 3, 2007

Here is what I am attempting to get accomplished. I have an SSIS package that contains a Foreach loop container. This container executes a number of SQL tasks in order: SQL Task 1, SQL Task 2, SQL Task 3.

if the SQL task 1 succeeds it should flow on to SQL Task 2 and 3. This works fine when the SQL tasks do not fail...

In the event of any SQL Task failing control should flow to a send mail task to alert about the failure. Next the Foreach loop container should go to the next enumeration in the Foreach loop container and start the next new SQL task 1. So far I have been able to get the control to flow to the send mail task when a SQL Task fails. What does not work is when one SQL Task fails the entire Foreach loop fails and does not move to the next enumeration. It should only fail the package and move on.

Any help would be appreciated....

View 5 Replies View Related

How Do I Fail A ForEach Loop...

Feb 6, 2008



if there are no files in the directory i'm searching? Or if not fail, give me something so that I know & can raise a flag as needed?

thanks

View 1 Replies View Related

Configure FTP In Foreach Loop

May 9, 2006

I need to put a FTP task inside a Foreach Loop Container to upload data files to many different FTP servers. The container holds a variable with object data type that includes necessory FTP info (FTP server address, login, password and remote path). How do I configure FTP task so that I can pass the variables to it?

Thanks,

Jia

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved