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

Monday, March 26, 2012

ProperCase() script to use in the dataflow

Does anyone have a nice script that can "Propercase" the values of a column in the dataflow. I was thinking of a Transform Script Task, with a Input and Output Column, which can be transformed.

With Propercase i think:

STEVEN SPIELBERG becomming Steven Spielberg

Maybe also with some exceptions soo that "DELIVERY EU" stays "Delivery EU"

you can use the following within a script to convert to proper case.

Row.Name = StrConv(Row.Name, vbProperCase)

You could setup some select case statements for exceptions...

Frank

sql

Monday, March 12, 2012

Programmically change Database MODEL

Hi all,
Is it possible to change the model of the Database thur code?
I am trying to automate the task of changing the database from one Model to
Simple and back. It is easy to do?
Any leads would be nice.
Thank Youfound the answer. thanks
"Binh Phung" wrote:

> Hi all,
> Is it possible to change the model of the Database thur code?
> I am trying to automate the task of changing the database from one Model t
o
> Simple and back. It is easy to do?
> Any leads would be nice.
> Thank You

Programmically change Database MODEL

Hi all,
Is it possible to change the model of the Database thur code?
I am trying to automate the task of changing the database from one Model to
Simple and back. It is easy to do?
Any leads would be nice.
Thank You
found the answer. thanks
"Binh Phung" wrote:

> Hi all,
> Is it possible to change the model of the Database thur code?
> I am trying to automate the task of changing the database from one Model to
> Simple and back. It is easy to do?
> Any leads would be nice.
> Thank You

Friday, March 9, 2012

Programmatically loop over variables in the variable dispenser?

In my custom task, I would like to loop over the variables in the variable dispenser, and only modify those that are of a certain type. Is this possible?

Thanks!

I think you can use Me.variables(x).getType to get the type of each variable. If that is not correct, you can define variables name sXXX for string, iXXX for integer, etc. Then parse the variable name, get the first character and determine the variable type.|||

That would work, but I should clarify my question:

I have the VariableDispenser object passed into my Execute method. I do not know ahead of time what variables will be accessible via this instance of the VariableDispenser object. I would like to loop over each variable that is accessible (again, without knowing its name), then perform an operation on it conditionally based on its type (which I will get from the getType method).

Sorry for not being clearer in my original post!

|||I know that we can say variables(0).xxxx to read the first variable. But I am not sure whether we can get the count of variables. If you can't get the count, what you can do is read variables(0), variables(1), etc like that, and put that code in a try..catch. If you get an exception as 'index out of range', come out of the loop.|||This would be a great way to loop over all the variables assuming I could get access to the entire variables collection to begin with. The problem is that all I have is the VariableDispenser object. The VariableDispenser object methods that interact with the Variables collection (LockForRead, LockOneForRead, etc.) require that I know the name of the variables I would like to access. In my component, I do not know this upfront. Unless I am missing something (and I hope I am), I think I am out of luck?|||

Hi David,

I am not sure whether I understood your problem correctly or not. If I am confusing you, I am sorry. So, what you want is variable name and its type before calling variableDispenser object method. If that is true, it is pretty much simple.

DTS.Variables collection has 'count', 'Name' and 'DataType' properties. Loop thru this collection to get the name of a variable and its datatype. If the datatype is what you are looking for, call the VariableDispenser method using the name that you got.

Hope it will work.

|||

Thiru,

No worries. I am probably not being as clear as I could be - I always find it difficult to describe technical problems on the first 3 or 4 tries. Thanks for the help thus far.

I should have clarified from the beginning that I writing my custom task in C#. All of my code exists within the Execute method of my task. I do not appear to have the equivalent of the DTS.Variables collection available to me. Instead, all I have is the VariableDispenser object. Again, I hope I am missing something simple here.

Thanks again for your help,

David

|||

Can I ask why you want to this? How does the type identify the variables you want to modify? I ask in case there is some better way which we could suggest to acheive your business case.

Donald

|||

The answer is kind of convoluted, but here goes:

I have a package that manages the execution of child packages. Exactly what child packages are to be executed in a given run of the parent package are store in a database table. The child packages stored in the database table are looped over in a ForEach loop, and executed sequentially.

Each child package also requires a set of variables for successful execution. The list of variables required differs for each child package. The value for each of the required variables is not going to be known until run-time, immediately before the child package executes. The easiest way for me to manage this is to have a database table that lists what variables are necessary for each child package, and what expression / database query should be executed at run-time to evaluate each variable.

I have found a number of limitations (perceived or real) within the current SSIS achitecture that makes what I am trying to accomplish difficult. To get around these limitations, I have created my own set of objects to interact with the variables stored in the database, evaluate them at run-time, and put them into a single custom "variable list" object (to which an SSIS variable is assigned) that is available to the child packages.

The problem I have is that my parent package contains the variable(s) assigned to the list object(s). For maximum portability, I do not want my child packages to have to know what the names of those variables are. Instead, I would like to write a custom task that loops over all variables accessible via the variable dispenser, identifies those of my custom type, iterates through all the custom variables in the list, and assigns those values to corresponding ssis child variables (of the same name).

I know - that is quite a mouthful, and likely is not as clear as it could be. I may be going down a path that is unnecessary as I have only been playing around with SSIS for about 3 weeks now. Any help / advice is much appreciated.

Thanks,

David

Programmatically get ScriptTask source code

Hi am trying without luck to load a package which contains a ScriptTask and read the source code of that task.

I can load the package and get the ScriptTask no problem.
However i am not sure how to get the source code.
I know i have to use the ScriptTaskCodeProvider and i assume the GetSourceCode() method.

This is what i have so far

ScriptTask scriptTask = taskHost.InnerObject as ScriptTask;
ScriptTaskCodeProvider codeProvider = new ScriptTaskCodeProvider();
codeProvider.LoadFromTask(scriptTask);
string sourceCode = codeProvider.GetSourceCode(scriptTask.VsaProjectName);

Any assistance greatly appreciated.

Cheers
Richard.

Application application = new Application();

Package package = application.LoadPackage(@."C:\Yukon\ISPlaying\ISPlaying\Package14.dtsx", null);

TaskHost taskHost = package.Executables[0] as TaskHost;

ScriptTask scriptTask = taskHost.InnerObject as ScriptTask;

ScriptTaskCodeProvider codeProvider = new ScriptTaskCodeProvider();

codeProvider.LoadFromTask(scriptTask);

string script = codeProvider.GetSourceCode(String.Format("dts://Scripts/{0}/ScriptMain.vsaitem", scriptTask.VsaProjectName));

Programmatically Evaluate Expression

I would like to evaluate expressions from within my execute function in a custom task. I saw this post from about 8 months ago detailing how it would be possible:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=117564&SiteID=1

Is there an updated response (or more detailed example) to the question? Am I really risking a lot by using this undocumented feature?

Thanks!

Hi David,

To quote Kirk from the thread you linked:

"...this is not documented and will not be supported by Microsoft. It could change at anytime and break your component if you use it. User beware. "

This remains the case. I encourage you to head over to the MSDN Product Feedback site at http://msdn.microsoft.com/sql/bi/integration/ and submit a suggestion for exposing this functionality.

Thanks
Mark

|||

Thanks for the feedback. I have submitted the suggestion:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=133078

Wednesday, March 7, 2012

Programmatically change property

In the old DTS, we can use the ActiveX Script to change any task's property programmatically.

Can we still do it in SSIS? Using the Script task? It seems changing the value of variables then use a expression can do some of the work, but what if a task has no expression defined?

Say, I want to change the Fuzzy look up reference table name.

Can we do it?

Hi,

No, you can't do this using the Script Task.

You CAN change any property of a task or container at runtime using a property expression: http://www.google.co.uk/search?hl=en&q=ssis+property+expression&meta=

You can change some properties of components (Fuzzy Lookup is a comoponent, not a task) at runtime using the same technique, but not many. The component properties that can be changed by property expressions are surfaced in the properties pane for the task in which the component resides.

-Jamie

Programmatically Access The ExecuteProcessTask

Hi all,

I am trying to programmatically create an Execute Process Task in an SSIS package.

So far, I have the following:

Private package As Package
Dim th As TaskHost = TryCast(package.Executables.Add("STOCK:ExecuteProcessTask"), TaskHost)
th.Name = "Execute Process Task"
th.Description = "Execute Process Task"

That will get me the ExecuteProcessTask in my package that I want. But now, I would like to set the properties of it (i.e., the executable and arguments)

Basically, my IDE does not have any idea what an "ExecuteProcessTask" is. After lots of research, I cannot find out which assembly I need to reference in order to gain access to this object. In addition, whenever I try to Import the assembly that I think it is (i.e. Microsoft.SqlServer.ExecProcTask, or Microsoft.SqlServer.Dts.Tasks.ExecuteProcess), none of them work. I can see in my Assembly Cache that the .dll is registered correctly ...

What is going on?
What do you mean "none of them work"? When you set a reference to the Microsoft.SqlServer.ExecProcTask.dll then the code below should work.

Code Snippet

Dim execProc As Microsoft.SqlServer.Dts.Tasks.ExecuteProcess.ExecuteProcess = CType(th.InnerObject, Microsoft.SqlServer.Dts.Tasks.ExecuteProcess.ExecuteProcess)
execProc.Executable = "executable.exe"
execProc.Arguments = "/arguments"

|||Really, my problem is that I can't access the assembly that I need.

Basically, I need access to the Microsoft.SqlServer.Dts.Tasks.ExecProcTask assembly-

But, when I try to add a reference to it, I do not see it. In addition, with the interface in SSIS, I cannot "browse" for the assembly.

The only assembly that shows up in Intellisense is Microsoft.SqlServer.Dts.Tasks.ScriptTask

I am editing a script task- so what good is a script task if I can't access the assemblies I need?

What can I do?

|||Ah, you need to copy it from C:\Program Files\Microsoft SQL Server\90\DTS\Tasks to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727. Then it will show up in your References.
|||Graahhhhh!! I just came up with that idea, tried it out and it worked- graahh-- wasted so much time and was so frustrated by that yesterday because of something so simple- I hate that!

Monday, February 20, 2012

Programatically Evaluating SSIS Expression

Is there an object in the DTS object model that will allow me to evaluate an SSIS expression? I am trying to build a custom task that will require re-evaluation of an expression multiple times within the execute method and I can't seem to find a way to do this.

Thanks,

Adam

Add a reference to Microsoft.DataTransformationServices.Controls

Use the Microsoft.SqlServer.Dts.Runtime.Wrapper.ExpressionEvaluatorClass class. You will want to use DTSInfoEvents to capture error details when calling Evaluate or Validate. Pass the events to the Events property of the ExpressionEvaluatorClass.

Take a look at the File Watcher Task (http://www.sqlis.com/) for an example of this in action, just set an expression through the task UI to see the Expression Editor Dialog we have built in action. It use the ExpressionEvaluatorClass behind the scenes to provide the evaluation functionality.

Not documented, so not supported, but it works.|||As Darren said, this is not documented and will not be supported by Microsoft. It could change at anytime and break your component if you use it.
User beware.|||

I have logged a bug to document and publicly expose this, but it was on Beta Place, so if someone wants to do the Product Feedback thing I'll vote for it.

Programatically created DataFLow task fails

Hi,

I have a package in which i have programatically created dataflow task. It used to work fine but now it fails with series of errors out of which one is below

Error 30002: Type 'MainPipe' is not defined. Line 63 Columns 33-40 Line Text: Dim DataFlowTask As MainPipe = CType(DataFlowTaskHost.InnerObject, MainPipe)

It seems all the function and classes referd from following dlls is not working:

Microsoft.SqlServer.DTSRuntimeWrap.dll

Microsoft.SqlServer.DTSPipelineWrap.dll

I say so because i get the following error also:

Error 30652: Reference required to assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' containing the type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90'. Add one to your project. Line 86 Columns 33-64 Line Text: DtsConvert.ToConnectionManager90(ChildPackage.Connections(""Source""))

These dlls are in GAC and in C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies with same version but still it gives above error.

Thanks

Mohit

Mohit,

If it used to work and now it doesn't (as you suggest) then if it were me I would try and track down what got changed in the interim.

-Jamie

|||

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

|||

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

|||

Jamie Thomson wrote:

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

Any pointers to the article resolving this specific error will be very helpful.

Mohit

|||

MohitGupta wrote:

Jamie Thomson wrote:

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

Any pointers to the article resolving this specific error will be very helpful.

Mohit

Have you added the reference that it talks about?

-Jamie

|||

Jamie Thomson wrote:

MohitGupta wrote:

Jamie Thomson wrote:

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

Any pointers to the article resolving this specific error will be very helpful.

Mohit

Have you added the reference that it talks about?

-Jamie

Yes the dlls are refered from the following location: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

|||

MohitGupta wrote:

Yes the dlls are refered from the following location: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

That's wrong. Reference them from the GAC.

-Jamie

|||

Jamie Thomson wrote:

MohitGupta wrote:

Yes the dlls are refered from the following location: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

That's wrong. Reference them from the GAC.

-Jamie

When the dll reference is added there is no option to browse and add assembly. It shows .NET assemblies which are from GAC out of which both the dll have this path: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies in the property box. This is on my development machine. But in dtsx file, it does not have any reference of this path. Below is the code generated used in production server:

<Reference

Name = "Microsoft.SqlServer.DTSPipelineWrap"

AssemblyName = "Microsoft.SqlServer.DTSPipelineWrap"

/>

<Reference

Name = "Microsoft.SQLServer.DTSRuntimeWrap"

AssemblyName = "Microsoft.SqlServer.DTSRuntimeWrap"

/>

I assume it is coming from GAC.

-Mohit

|||

MohitGupta wrote:

Jamie Thomson wrote:

When the dll reference is added there is no option to browse and add assembly. It shows .NET assemblies which are from GAC out of which both the dll have this path: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies in the property box. This is on my development machine. But in dtsx file, it does not have any reference of this path. Below is the code generated used in production server:

<Reference

Name = "Microsoft.SqlServer.DTSPipelineWrap"

AssemblyName = "Microsoft.SqlServer.DTSPipelineWrap"

/>

<Reference

Name = "Microsoft.SQLServer.DTSRuntimeWrap"

AssemblyName = "Microsoft.SqlServer.DTSRuntimeWrap"

/>

I assume it is coming from GAC.

-Mohit

This "property box" that you speak of. What object does that contain the properties of? On my machine I check properties of Microsoft.SqlServer.DTSPipelineWrap in c:\windows\assembly and there is no mention of a path anywhere. I'm confused.

The .dtsx file will not contain paths to DLLs, that's the whole point of GACing them.

-Jamie

|||

Finally I got resolution to this issue Smile

Cause:

Security Update for Microsoft .Net Framework 2.0 (KB928365) is installed on the server which causes SSIS packages to fail (Specifically custom data flow tasks using GACed dll)

Resolution:

Install this KB: SQLServer2005-KB932557-x86-ENU.exe on the server.

Link: http://support.microsoft.com/kb/932557/

This KB while installing gives option to Install the patch only for SQL Server Integration Services 2005 and SQL Server Tools and Workstation Components 2005. This KB is not required to be installed for SQL Server Instances. (Restart not required)

Known Issue:

After installing this KB, few warnings may be displayed which are known issues with SSIS.

Thanks

Mohit

Programatically created DataFLow task fails

Hi,

I have a package in which i have programatically created dataflow task. It used to work fine but now it fails with series of errors out of which one is below

Error 30002: Type 'MainPipe' is not defined. Line 63 Columns 33-40 Line Text: Dim DataFlowTask As MainPipe = CType(DataFlowTaskHost.InnerObject, MainPipe)

It seems all the function and classes referd from following dlls is not working:

Microsoft.SqlServer.DTSRuntimeWrap.dll

Microsoft.SqlServer.DTSPipelineWrap.dll

I say so because i get the following error also:

Error 30652: Reference required to assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' containing the type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90'. Add one to your project. Line 86 Columns 33-64 Line Text: DtsConvert.ToConnectionManager90(ChildPackage.Connections(""Source""))

These dlls are in GAC and in C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies with same version but still it gives above error.

Thanks

Mohit

Mohit,

If it used to work and now it doesn't (as you suggest) then if it were me I would try and track down what got changed in the interim.

-Jamie

|||

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

|||

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

|||

Jamie Thomson wrote:

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

Any pointers to the article resolving this specific error will be very helpful.

Mohit

|||

MohitGupta wrote:

Jamie Thomson wrote:

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

Any pointers to the article resolving this specific error will be very helpful.

Mohit

Have you added the reference that it talks about?

-Jamie

|||

Jamie Thomson wrote:

MohitGupta wrote:

Jamie Thomson wrote:

MohitGupta wrote:

Hi Jamie,

There is no change in code because it was deployed in production. Is there possibility of this error being caused by any SQL server service pack or hotfix on the server.

Thanks

Mohit

yes, its certainly a possibility. That's what I meant by identify what has changed. Code changes? Service pack changes? Windows Update changes? They're all changes that could *potentially* cause problems.

-Jamie

Any pointers to the article resolving this specific error will be very helpful.

Mohit

Have you added the reference that it talks about?

-Jamie

Yes the dlls are refered from the following location: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

|||

MohitGupta wrote:

Yes the dlls are refered from the following location: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

That's wrong. Reference them from the GAC.

-Jamie

|||

Jamie Thomson wrote:

MohitGupta wrote:

Yes the dlls are refered from the following location: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

That's wrong. Reference them from the GAC.

-Jamie

When the dll reference is added there is no option to browse and add assembly. It shows .NET assemblies which are from GAC out of which both the dll have this path: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies in the property box. This is on my development machine. But in dtsx file, it does not have any reference of this path. Below is the code generated used in production server:

<Reference

Name = "Microsoft.SqlServer.DTSPipelineWrap"

AssemblyName = "Microsoft.SqlServer.DTSPipelineWrap"

/>

<Reference

Name = "Microsoft.SQLServer.DTSRuntimeWrap"

AssemblyName = "Microsoft.SqlServer.DTSRuntimeWrap"

/>

I assume it is coming from GAC.

-Mohit

|||

MohitGupta wrote:

Jamie Thomson wrote:

When the dll reference is added there is no option to browse and add assembly. It shows .NET assemblies which are from GAC out of which both the dll have this path: C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies in the property box. This is on my development machine. But in dtsx file, it does not have any reference of this path. Below is the code generated used in production server:

<Reference

Name = "Microsoft.SqlServer.DTSPipelineWrap"

AssemblyName = "Microsoft.SqlServer.DTSPipelineWrap"

/>

<Reference

Name = "Microsoft.SQLServer.DTSRuntimeWrap"

AssemblyName = "Microsoft.SqlServer.DTSRuntimeWrap"

/>

I assume it is coming from GAC.

-Mohit

This "property box" that you speak of. What object does that contain the properties of? On my machine I check properties of Microsoft.SqlServer.DTSPipelineWrap in c:\windows\assembly and there is no mention of a path anywhere. I'm confused.

The .dtsx file will not contain paths to DLLs, that's the whole point of GACing them.

-Jamie

|||

Finally I got resolution to this issue Smile

Cause:

Security Update for Microsoft .Net Framework 2.0 (KB928365) is installed on the server which causes SSIS packages to fail (Specifically custom data flow tasks using GACed dll)

Resolution:

Install this KB: SQLServer2005-KB932557-x86-ENU.exe on the server.

Link: http://support.microsoft.com/kb/932557/

This KB while installing gives option to Install the patch only for SQL Server Integration Services 2005 and SQL Server Tools and Workstation Components 2005. This KB is not required to be installed for SQL Server Instances. (Restart not required)

Known Issue:

After installing this KB, few warnings may be displayed which are known issues with SSIS.

Thanks

Mohit

Programatic or expression for failure

Hello,

Is there a way is a script task or via a procedural expression to tell if a package is going to fail because of an error?

This would be used to fire something which should occure if the max number of errors/error severity to fail the package had been reached

Thanks

Paul

Hi Paul,

I'm unaware of a way to tell before execution that a package is going to encounter n number of errors. You can use the DtExec /Validate switch (or check the Validate package without executing checkbox in DtExecUI) to perform a package validation, but validation will not catch all conditions that can raise errors during execution.

You may want to check into SSIS Event Handlers. These allow you to respond to error conditions.

Hope this helps,

Andy

|||

Sorry I did not clarify the problem very well.

When a package is running and an OnError event handeler is called i want it to do somthing specific if the package will fail because of the error. usually a OnError would cause the package to fall over but i have changed the package to allowed errors to be 3 so not every error would cause the package to fail.

e.g.

Error 1 would send an email

Error 2 would send an email

Error 3 would send an email and move a file (the package would fail at this point)

|||

Hi Paul,

Oh, ok. Count the errors.

Create a package-scoped variable called iErrorCount of Int32 data type. Make the first task in your OnError Event Handler a Script Task that contains code similar to the following:

Code Snippet

Dim iErrCount as Integer =

Convert.ToInt32(

Dts.Variables("iErrorCount").Value)

iErrCount += 1

If iErrCount >= 3 Then

...

Hope this helps,

Andy