Showing posts with label package. Show all posts
Showing posts with label package. Show all posts

Thursday, March 22, 2012

Conversion error

Hi all,

Basically I am trying to create a package that will

(A) Create a table with specified datatypes

(B) Use a text Source file for the data

(C) on Success \ Completion of the "Execute SQL" transform the data from the text into the table.

Connect to DB <-- [TRANSFROM]-- Text (Source) <-- Execute SQL (Create Table)

It all seems to work now but when I run the package I get the following error

The number of failing rows exceeds the maximum specified.

TransformCopy 'DTSTransformation_6'conversion error: Conversion invalid for datatypes on column on pair 1 (source column 'Col007' (DBTYPE_STR),destination column 'Rec_Amt' (DBTYPE_CY)).

But when I go into the TransformDataTask, under transformation and test that column it all works fine, infact I tested all the columns and they all seem to work fine.

It also seems to be creating the same table twice first in the " Execute SQL" task and then again for some reason in the "DataTransform" task. I dont know if that is realted to the problem or not though.

Any idea's or suggestions I could try ?

Im very new to SQL 2000 & DTS so dont rule out any very newbie errors :)

Thanks

I'm not sure what steps you created, so I'm uncertain as to why it would duplicate the table. I would create one step to read the text file and create the table, and another to fill it. Here's a broad reference with guidelines, and if you have further questions you can check out Books Online for SQL Server 2000 to read more:

http://support.microsoft.com/default.aspx/kb/242377

Buck Woody

Conversion error

Hi all,

Basically I am trying to create a package that will

(A) Create a table with specified datatypes

(B) Use a text Source file for the data

(C) on Success \ Completion of the "Execute SQL" transform the data from the text into the table.

Connect to DB <-- [TRANSFROM]-- Text (Source) <-- Execute SQL (Create Table)

It all seems to work now but when I run the package I get the following error

The number of failing rows exceeds the maximum specified.

TransformCopy 'DTSTransformation_6'conversion error: Conversion invalid for datatypes on column on pair 1 (source column 'Col007' (DBTYPE_STR),destination column 'Rec_Amt' (DBTYPE_CY)).

But when I go into the TransformDataTask, under transformation and test that column it all works fine, infact I tested all the columns and they all seem to work fine.

It also seems to be creating the same table twice first in the " Execute SQL" task and then again for some reason in the "DataTransform" task. I dont know if that is realted to the problem or not though.

Any idea's or suggestions I could try ?

Im very new to SQL 2000 & DTS so dont rule out any very newbie errors :)

Thanks

I'm not sure what steps you created, so I'm uncertain as to why it would duplicate the table. I would create one step to read the text file and create the table, and another to fill it. Here's a broad reference with guidelines, and if you have further questions you can check out Books Online for SQL Server 2000 to read more:

http://support.microsoft.com/default.aspx/kb/242377

Buck Woody

Monday, March 19, 2012

Controls disappear

Is it not possible to execute one package and then design another package? I am executing one package and trying to design another package and just have a grey window in the control tool box that says:

"there are no usable controls in this group. Drag an item onto this text to add it to the toolbar"

Can I only get my controls by dragging when another package is executing? Where do I drag them from?

Thanks,

Kayda

You seem quite new to this and some things are very odd about SSIS.

The controls are dragged from the Toolbox window. Get this by clicking on the "spanner and hammer" icon at the top. Or Crtl+Alt+X or via the menu View->Toolbox.

You have to be on the Control Flow or Data Flow panels. You get different tools for the 2 different contexts.

Also, you need to check you are executing the correct package. In the Solution Explorer, under the SSIS Packages folder right click on your xxxxxx.dtsx file and select "Set as StartUp Object" for the package you want to execute ... or just select "Execute Package" to run the one you want. You have to stop debugging the previous package before you design or run the next one.

Since you have already done one package, I may have misunderstood your questions.

Hope this helps

|||

Hi Kayda,

The Visual Studio Integrated Development Environment (IDE) changes modes when the debugger starts. It disables most editing functionality until it exits debug mode. It also hides controls in the toolboxes. This is by design.

Although the package execution is complete, the IDE remains in debug mode until stopped (Shift-F5 or the VCR-style Stop button will do it).

This is different from DTS and a normal source of confusion for folks making the transition.

Hope this helps,
Andy

|||Perhaps you could open a second session of BIDS; or use DTExec or DTExecUI to execute the packages while still developing other packages

Sunday, March 11, 2012

Controlling job steps using ActiveX Script

Hi,
we have to setup a job that will execute a DTS Package to enrich a file.
But we don't want to execute the DTS if the file is not there.
So how can I use an ActiveX Script to control whether the DTS Package is executed?
thanks
Philip
Philip,
Why can't you just check for existence of the file in the DTS package,
if it's not there, exit the package?
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Philip wrote:
> Hi,
> we have to setup a job that will execute a DTS Package to enrich a file.
> But we don't want to execute the DTS if the file is not there.
> So how can I use an ActiveX Script to control whether the DTS Package is executed?
> thanks
> Philip
|||Hi,
Well, how can I exit the package gracefully with no errors - there are 8 steps, so I'd need to exit straightaway?
thanks
Philip
"Mark Allison" wrote:

> Philip,
> Why can't you just check for existence of the file in the DTS package,
> if it's not there, exit the package?
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Philip wrote:
>
|||Hi,
Well, how can I exit the package gracefully with no errors - there are 8 steps, so I'd need to exit straightaway?
thanks
Philip
"Mark Allison" wrote:

> Philip,
> Why can't you just check for existence of the file in the DTS package,
> if it's not there, exit the package?
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Philip wrote:
>
|||Philip
CREATE FUNCTION dbo.fn_file_exists(@.filename VARCHAR(300))
RETURNS INT
AS
BEGIN
DECLARE @.file_exists AS INT
EXEC master..xp_fileexist @.filename, @.file_exists OUTPUT
RETURN @.file_exists
END
GO
-- test
SELECT dbo.fn_file_exists('c:\a.txt')
PS. You can define a first step of the job to identify whether or not the
file exist
"Philip" <Philip@.discussions.microsoft.com> wrote in message
news:416843B5-27F1-4BCB-9D32-44C73558F2CC@.microsoft.com...
> Hi,
> we have to setup a job that will execute a DTS Package to enrich a file.
> But we don't want to execute the DTS if the file is not there.
> So how can I use an ActiveX Script to control whether the DTS Package is
executed?
> thanks
> Philip

Controlling job steps using ActiveX Script

Hi,
we have to setup a job that will execute a DTS Package to enrich a file.
But we don't want to execute the DTS if the file is not there.
So how can I use an ActiveX Script to control whether the DTS Package is exe
cuted?
thanks
PhilipPhilip,
Why can't you just check for existence of the file in the DTS package,
if it's not there, exit the package?
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Philip wrote:
> Hi,
> we have to setup a job that will execute a DTS Package to enrich a file.
> But we don't want to execute the DTS if the file is not there.
> So how can I use an ActiveX Script to control whether the DTS Package is e
xecuted?
> thanks
> Philip|||Hi,
Well, how can I exit the package gracefully with no errors - there are 8 ste
ps, so I'd need to exit straightaway?
thanks
Philip
"Mark Allison" wrote:

> Philip,
> Why can't you just check for existence of the file in the DTS package,
> if it's not there, exit the package?
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Philip wrote:
>|||Hi,
Well, how can I exit the package gracefully with no errors - there are 8 ste
ps, so I'd need to exit straightaway?
thanks
Philip
"Mark Allison" wrote:

> Philip,
> Why can't you just check for existence of the file in the DTS package,
> if it's not there, exit the package?
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Philip wrote:
>|||Philip
CREATE FUNCTION dbo.fn_file_exists(@.filename VARCHAR(300))
RETURNS INT
AS
BEGIN
DECLARE @.file_exists AS INT
EXEC master..xp_fileexist @.filename, @.file_exists OUTPUT
RETURN @.file_exists
END
GO
-- test
SELECT dbo.fn_file_exists('c:\a.txt')
PS. You can define a first step of the job to identify whether or not the
file exist
"Philip" <Philip@.discussions.microsoft.com> wrote in message
news:416843B5-27F1-4BCB-9D32-44C73558F2CC@.microsoft.com...
> Hi,
> we have to setup a job that will execute a DTS Package to enrich a file.
> But we don't want to execute the DTS if the file is not there.
> So how can I use an ActiveX Script to control whether the DTS Package is
executed?
> thanks
> Philip

Controlling job steps using ActiveX Script

Hi,
we have to setup a job that will execute a DTS Package to enrich a file.
But we don't want to execute the DTS if the file is not there.
So how can I use an ActiveX Script to control whether the DTS Package is executed?
thanks
PhilipPhilip,
Why can't you just check for existence of the file in the DTS package,
if it's not there, exit the package?
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Philip wrote:
> Hi,
> we have to setup a job that will execute a DTS Package to enrich a file.
> But we don't want to execute the DTS if the file is not there.
> So how can I use an ActiveX Script to control whether the DTS Package is executed?
> thanks
> Philip|||Hi,
Well, how can I exit the package gracefully with no errors - there are 8 steps, so I'd need to exit straightaway?
thanks
Philip
"Mark Allison" wrote:
> Philip,
> Why can't you just check for existence of the file in the DTS package,
> if it's not there, exit the package?
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Philip wrote:
> > Hi,
> >
> > we have to setup a job that will execute a DTS Package to enrich a file.
> >
> > But we don't want to execute the DTS if the file is not there.
> >
> > So how can I use an ActiveX Script to control whether the DTS Package is executed?
> >
> > thanks
> >
> > Philip
>|||Hi,
Well, how can I exit the package gracefully with no errors - there are 8 steps, so I'd need to exit straightaway?
thanks
Philip
"Mark Allison" wrote:
> Philip,
> Why can't you just check for existence of the file in the DTS package,
> if it's not there, exit the package?
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> Philip wrote:
> > Hi,
> >
> > we have to setup a job that will execute a DTS Package to enrich a file.
> >
> > But we don't want to execute the DTS if the file is not there.
> >
> > So how can I use an ActiveX Script to control whether the DTS Package is executed?
> >
> > thanks
> >
> > Philip
>|||Philip
CREATE FUNCTION dbo.fn_file_exists(@.filename VARCHAR(300))
RETURNS INT
AS
BEGIN
DECLARE @.file_exists AS INT
EXEC master..xp_fileexist @.filename, @.file_exists OUTPUT
RETURN @.file_exists
END
GO
-- test
SELECT dbo.fn_file_exists('c:\a.txt')
PS. You can define a first step of the job to identify whether or not the
file exist
"Philip" <Philip@.discussions.microsoft.com> wrote in message
news:416843B5-27F1-4BCB-9D32-44C73558F2CC@.microsoft.com...
> Hi,
> we have to setup a job that will execute a DTS Package to enrich a file.
> But we don't want to execute the DTS if the file is not there.
> So how can I use an ActiveX Script to control whether the DTS Package is
executed?
> thanks
> Philip

Control+Z when you design a package?

Hi everyone,

Is Microsoft thinking over the possibility to implement Control+Z in order to avoid drawbacks when you're writing a package? I mean, when you drop a container then you aren't able to retrieve again

.

That same behaviour happened with Sql2k-dts.

Thanks in advance and regards,

Thanks for your suggestion. We will consider this for a future release.

Bob

|||

enric vives wrote:

Hi everyone,

Is Microsoft thinking over the possibility to implement Control+Z in order to avoid drawbacks when you're writing a package? I mean, when you drop a container then you aren't able to retrieve again

.

That same behaviour happened with Sql2k-dts.

Thanks in advance and regards,

Log it at Connect. I will definately vote for it.

-Jamie

Control/Limit Memory usage

Hello,

I was wondering if there was a setting or a way to limit or restrict the amount of Memory an SSIS package can use? I know that by default the windows OS limits a process (a package in this case) to 2GB and up to 3GB with AWE enable but what if I wanted to say Limit it to 1GB of memory is there anyway to do that? Is there an SSIS Engine setting or Package property somewhere?

Thanks!

See if this helps you. Check out the Buffer size section in this paper:
http://www.microsoft.com/technet/prodtechnol/sql/2005/ssisperf.mspx

Thursday, March 8, 2012

Control Flow Task Error shouldn't fail package

Hi all,

I have a Send Mail Task in my control flow to notify users that the processing is done. I want to avoid the package to fall in error if the Send Mail task failed.

What is the best practice to do that ?

Should I raise the MaximumErrorCount of theSend Mail Task ? Should I play with ErrorHandler ?

Try setting the Send Mail Task's "ForceExecutionResult" to "Success"

Control Flow setup

Is it possible to setup a Control Flow at the solution level rather than at the package level? I'd like to setup a Control Flow that truncates multiple tables in a staging database then runs multiple packages that reloads those tables. Each package has a Control Flow tab that seems to be specific to the package. Is it possible to set something up that governs the execution of multiple packages?

Thanks.

SSIS contains a task called the "Execute package Task" which does it exactly what it says on the tin. It is ideally suited to the scenario you mentioned.

-Jamie

|||Since the control flows are all at the package level, if you have a solution with multiple packages, you probably need to just pick a control flow from one of the packages and use that control flow to run all the packages at once using the 'execute package task' you mentioned. There should be control flow objects at the solution level that control the running of all packages. Most etl tools have this.|||

lwrich wrote:

Since the control flows are all at the package level, if you have a solution with multiple packages, you probably need to just pick a control flow from one of the packages and use that control flow to run all the packages at once using the 'execute package task' you mentioned.

I'm not understanding why that is a problem. Can you elaborate?

lwrich wrote:

There should be control flow objects at the solution level that control the running of all packages. Most etl tools have this.

This isn't meant to be as rude as it sounds but I couldn't disagree more. SSIS has this i.e. control-flow objects to control the running of packages as well - packages themselves. It seems you are suggesting that we use SSIS packages for "work" and a completely different tool for workflow.

SSIS packages have a a workflow engine built into them so why would you use something else?

That's not rhetoric. I'm interested to hear your views here.

-Jamie

Control flow drawing bug

Minor issue here. But I just wanted to point it out.

I think this is how to reproduce it. If I disable a dataflow task and run the package, after it is complete, but yet still in the debugger, reenable the dataflow task. When I close the debugger, the dataflow task is still shaded as if it were disabled, but it will execute on the next run.

Close the package and re-open it and the work flow task is drawn correctly.

Thanks for the report, Jim. What build is this with? We've fixed one of these occurrences recently.

regards,
ash|||I am still on the April CTP.|||OK. I believe this has been fixed in the next CTP (CTP16). Please review when you get that, thanks!

Wednesday, March 7, 2012

Continue package execution on task failure

Hi,

I am developing an SSIS package and need the execution of the package to continue even if one of the tasks within the package fails. I have an OnError event handler for this task which fires when it fails but want the rest of the package to continue.

Any suggestions greatly appreciated.

Thanks

Hi PK2000

Can you tell me on what kind of package it fails on and what the next package is that you want to execute?

Kind Regards,

Joos Nieuwoudt

|||

Hi Joos,

I probably didn't explain the problem clearly......

I have one SSIS package with multiple tasks. I want the the package to continue even if the first task within the package fails.

Thanks

|||Hi

by default the arrows between your tasks on the control flow (precedence constraints) are green. It means that you require the task to be successful in order for the next task to be launched.

You can change this behaviour by double-clicking on the green arrow to change the constraint value from 'Success' (green) to 'Completion' (blue) - the next task will then be executed on both failure or success.

cheers

Thibaut|||

Hi PK2000,

Sorry, I understood your question wrong but Thibaut's answer is correct. Try it.

Kind Regards,

Joos Nieuwoudt.

Continue after error

I have an SSIS package that uses a for each loop to send an order confirmation e-mail. If it does not find an email I need the package to continue after the failure path. The package stops after the failure, but I need it to continue with the next iteration of the for each loop. How can I do this?

Suppress execution error propagation up the container hierarchy, so that the foreach loop container is unaware of errors in its own executables.

Specifically, set the Propagate system variable to false on an event handler scoped below the foreach loop container. Propagate is a system variable which controls upward execution error propagation.

See the following post for more details on how to set the value of this system variable.

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

Now, for validation errors, which will always bubble up at least one level up the container hierarchy, you'll have to set do something like setting the MaximumErrorCount to a large number on the foreach loop container.

|||

That works for me. Thanks.

Sunday, February 19, 2012

Consuming from Web Service and Load data into SQL

Hi:

Can someone help me with a SSIS package that would consume from a Web Service (in fact two of them) and then load the data into SQL Server. I currently have Web Service task which connects to ForEachLoop task, and inside the loop task, I have a DFT. I am thinking, I would need to call the webservice utilizing the Web Services Task, and then store the output in a Full ResultSet variable. In my loop, I would like to loop thru the resultset, and store the data into SQL server. Inside the DFT, how would I construct this mechanism? Also, is this a good way to consume from a Web Service and then populate SQL Server? Are there any alternate ideas on this? Any documentation on this yet? Thanks.

MA,

Let me clarify. Do you want to consume data from a web service from within the data-flow?

-Jamie

|||

Well, the goal is to call a web service, and pump data into SQL server, although I thought it's less complex to hook up to a Web Services Task, and then utilize the output from the Web Services within a DFT somehow but not sure. Is there a better way to do this. Thanks.

|||

I think so, yes. It is possible to consume data from a web service from directly within the pipeline. What you are proposing would be an extra step.

To consume from a web service in the pipeline you will need a script component. Donald Farmer's book (http://www.amazon.com/Rational-Guide-Extending-Script-Guides/dp/1932577254/ref=pd_bbs_sr_1/104-7087211-5731917?ie=UTF8&s=books&qid=1181582618&sr=8-1) has a chapter explaining how to do it.

-Jamie

|||

It looks like utilizing the XML Adapter task in the DFT, would allow us to read data from a Variable, not sure how this feature works, but will provide comments, once its working for me. My goal is to avoid using the script component, and utilize existing tasks to accomplish this goal, lets see where I get with that :-)

|||

MA2005 wrote:

It looks like utilizing the XML Adapter task in the DFT, would allow us to read data from a Variable, not sure how this feature works, but will provide comments, once its working for me. My goal is to avoid using the script component, and utilize existing tasks to accomplish this goal, lets see where I get with that :-)

Fair enough. I think that's a worthy aim.

Out of interest, why do you not want to use the script component?

-Jamie

|||

No reason, just exploring an alternate solution. :-)

Consuming events in code

Hi,

Ive been taking a look at how to consume events from a package when executing programatically.

Ive got some code (copied below) that creates a package programatically, adds a sequence container then within that adds a script task , then executes it using the overloaded method of Package.Execute() that takes an IDtsEvents argument.

My class that implements IDtsEvents simply output a message to the console for each event type.

Weird thing is, when I execute, this is the only output I get:

Starting...
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.Package
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.Sequence
OnPreValidate: Microsoft.SqlServer.Dts.Runtime.TaskHost
OnPostValidate:Microsoft.SqlServer.Dts.Runtime.TaskHost
OnQueryCancel
Package ran successfully

What I find weird is that I dont get information for loads of other event types. I would at least have expected to see some OnPostExecute events.

Anyone know why i dont see all of the events?

Thanks

Jamie

Heres the code:

Code Snippet

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.SqlServer.Dts.Runtime;

using Microsoft.SqlServer.Dts.Tasks.ScriptTask;

namespace Package_API

{

class Program

{

static void Main(string[] args)

{

Console.WriteLine("Starting...");

Package p = new Package();

p.InteractiveMode = true;

p.OfflineMode = true;

// Add a Script Task to the package.

Sequence s = (Sequence)p.Executables.Add("STOCK:Sequence");

TaskHost taskH = (TaskHost)s.Executables.Add("STOCK:ScriptTask");

// Run the package.

DtsEvents events = new DtsEvents();

p.Execute(null,null,events,null,null);

//p.Execute();

if (p.ExecutionResult == DTSExecResult.Failure || p.ExecutionStatus == DTSExecStatus.Abend)

Console.WriteLine("Package failed or abended");

else

Console.WriteLine("Package ran successfully");

Console.ReadLine();

}

}

}

// Class that implements the IDTSEvents interface:

public sealed class DtsEvents : IDTSEvents

{

void IDTSEvents.OnPreExecute(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPreExecute: " + exec.ToString());

}

void IDTSEvents.OnBreakpointHit(IDTSBreakpointSite breakpointSite, BreakpointTarget breakpointTarget)

{

Console.WriteLine("OnBreakpointHit");

}

void IDTSEvents.OnCustomEvent(TaskHost taskHost,string eventName,string eventText,ref Object[] arguments,string subComponent,ref bool fireAgain)

{

Console.WriteLine("CustomEvent");

}

void IDTSEvents.OnPreValidate(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPreValidate: " + exec.ToString());

}

void IDTSEvents.OnPostValidate(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPostValidate:" + exec.ToString());

}

void IDTSEvents.OnWarning(DtsObject source,int warningCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError)

{

Console.WriteLine("OnWarning");

}

void IDTSEvents.OnInformation(DtsObject source,int informationCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError,ref bool fireAgain)

{

Console.WriteLine("OnInformation");

}

void IDTSEvents.OnPostExecute(Executable exec, ref bool fireAgain)

{

Console.WriteLine("OnPostExecute");

}

bool IDTSEvents.OnError(DtsObject source,int errorCode,string subComponent,string description,string helpFile,int helpContext,string idofInterfaceWithError)

{

Console.WriteLine("OnError");

return true;

}

void IDTSEvents.OnTaskFailed(TaskHost taskHost)

{

Console.WriteLine("OnTaskFailed");

}

void IDTSEvents.OnProgress(TaskHost taskHost,string progressDescription,int percentComplete,int progressCountLow,int progressCountHigh,string subComponent,ref bool fireAgain)

{

Console.WriteLine("OnProgress");

}

bool IDTSEvents.OnQueryCancel()

{

Console.WriteLine("OnQueryCancel");

return true;

}

void IDTSEvents.OnExecutionStatusChanged(Executable exec,DTSExecStatus newStatus,ref bool fireAgain)

{

Console.WriteLine("OnExecutionStatusChanged");

}

void IDTSEvents.OnVariableValueChanged(DtsContainer DtsContainer,Variable variable,ref bool fireAgain)

{

Console.WriteLine("OnVariableValueChanged");

}

}

By returning true from OnQueryCancel, you are cancelling the package Smile

Just add Console.WriteLine(p.ExecutionResult) - it should be Cancelled.

Return false from this method, or inherit from DefaultEvents and only override methods that you actually need.

|||

Michael Entin - MSFT wrote:

By returning true from OnQueryCancel, you are cancelling the package

Just add Console.WriteLine(p.ExecutionResult) - it should be Cancelled.

Return false from this method, or inherit from DefaultEvents and only override methods that you actually need.

DOH!!!

What a dumbass. I should have realised that!


Thanks Michael!

-Jamie

|||

How odd, Jamie. According my class I can follow each event -including post and pre executing...

Dim EventsSSIS As EventosSSIS
EventsSSIS = New EventosSSIS()
sResultDts = pkg.Execute(Nothing, Nothing, EventsSSIS, Nothing, Nothing)

Public Class EventosSSIS
Implements IDTSEvents
Public proceso As Int16 = 0

Sub OnPostValidate(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPostValidate
End Sub
Sub OnProgress(ByVal taskHost As TaskHost, ByVal progressDescription As String, ByVal percentComplete As Integer, ByVal progressCountLow As Integer, ByVal progressCountHigh As Integer, ByVal subComponent As String, ByRef fireAgain As Boolean) Implements IDTSEvents.OnProgress
End Sub
Sub OnPreExecute(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPreExecute
End Sub
Sub OnPreValidate(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPreValidate
End Sub
Sub OnPostExecute(ByVal exec As Executable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnPostExecute
End Sub
Sub OnWarning(ByVal source As DtsObject, ByVal warningCode As Integer, ByVal subComponent As String, ByVal description As String, ByVal helpFile As String, ByVal helpContext As Integer, ByVal idofInterfaceWithError As String) Implements IDTSEvents.OnWarning
End Sub
Sub OnInformation(ByVal [source] As DtsObject, ByVal informationCode As Integer, ByVal subComponent As String, ByVal description As String, ByVal helpFile As String, ByVal helpContext As Integer, ByVal idofInterfaceWithError As String, ByRef fireAgain As Boolean) Implements IDTSEvents.OnInformation
End Sub
Sub OnTaskFailed(ByVal taskHost As TaskHost) Implements IDTSEvents.OnTaskFailed
End Sub
Function OnError(ByVal source As DtsObject, ByVal errorCode As Integer, ByVal subComponent As String, ByVal description As String, ByVal helpFile As String, ByVal helpContext As Integer, ByVal idofInterfaceWithError As String) As Boolean Implements IDTSEvents.OnError
End Function
Sub OnExecutionStatusChanged(ByVal exec As Executable, ByVal newStatus As DTSExecStatus, ByRef fireAgain As Boolean) Implements IDTSEvents.OnExecutionStatusChanged
End Sub
Sub OnCustomEvent(ByVal taskHost As TaskHost, ByVal eventName As String, ByVal eventText As String, ByRef arguments() As Object, ByVal subComponent As String, ByRef fireAgain As Boolean) Implements IDTSEvents.OnCustomEvent
End Sub
Sub OnBreakpointHit(ByVal breakpointSite As IDTSBreakpointSite, ByVal breakpointTarget As BreakpointTarget) Implements IDTSEvents.OnBreakpointHit
End Sub
Sub OnVariableValueChanged(ByVal dtsContainer As DtsContainer, ByVal variable As Variable, ByRef fireAgain As Boolean) Implements IDTSEvents.OnVariableValueChanged
End Sub
Public Overloads Function OnQueryCancel() As Boolean Implements IDTSEvents.OnQueryCancel
Dim cancelar As Int32 = 0
OnQueryCancel = False
Try
Using cn As New SqlConnection(sCadenadeConexion)
cn.Open()
Using cm As SqlCommand = cn.CreateCommand
cm.CommandType = Data.CommandType.Text
cm.CommandText = "SELECT cancelar FROM sis_controlthread where idproceso= " & proceso
cancelar = cm.ExecuteScalar
If cancelar Then
OnQueryCancel = True
Else
OnQueryCancel = False
End If
cm.Dispose()
End Using
cn.Close()
End Using
Catch ex As Exception
TratamientoErrores(0, 0, 11, ex.Message, "On Query Cancel")
End Try
End Function
End Class

Consume DataReaderDest from asp.net page?

I have seen the other posts about how to use Microsoft.SqlServer.Dts.DtsClient to run a package and get back the DataReader results. But this fails when run from a client mahcine that does not have SSIS installed. I want to have this page on a web server run the package on a remote Sql Server machine and get back the results but have so far failed. Any one got this working?


protected void Page_Load(object sender, EventArgs e)
{
string path = @."C:\Documents and Settings\Brandon\My Documents\Visual Studio 2005\Projects\Integration Services Project5\Integration Services Project5\FuzzyLookup.dtsx";

DtsConnection connection = new DtsConnection();
connection.ConnectionString = string.Format(@."-f ""{0}""", path);
connection.Open();

DtsCommand command = new DtsCommand(connection);
command.CommandText = "DataReaderDest";

IDataReader reader = command.ExecuteReader(CommandBehavior.Default);

DataSet set = new DataSet();
set.Load(reader, LoadOption.OverwriteChanges, reader.GetSchemaTable().TableName);

_grid.DataSource = set;
_grid.DataBind();

connection.Close();

}

You have to install the SSIS components on the machine where you are executing the SSIS package (which does require a license of SQL Server).

Consume DataReaderDest from asp.net page?

I have seen the other posts about how to use Microsoft.SqlServer.Dts.DtsClient to run a package and get back the DataReader results. But this fails when run from a client mahcine that does not have SSIS installed. I want to have this page on a web server run the package on a remote Sql Server machine and get back the results but have so far failed. Any one got this working?


protected void Page_Load(object sender, EventArgs e)
{
string path = @."C:\Documents and Settings\Brandon\My Documents\Visual Studio 2005\Projects\Integration Services Project5\Integration Services Project5\FuzzyLookup.dtsx";

DtsConnection connection = new DtsConnection();
connection.ConnectionString = string.Format(@."-f ""{0}""", path);
connection.Open();

DtsCommand command = new DtsCommand(connection);
command.CommandText = "DataReaderDest";

IDataReader reader = command.ExecuteReader(CommandBehavior.Default);

DataSet set = new DataSet();
set.Load(reader, LoadOption.OverwriteChanges, reader.GetSchemaTable().TableName);

_grid.DataSource = set;
_grid.DataBind();

connection.Close();

}

You have to install the SSIS components on the machine where you are executing the SSIS package (which does require a license of SQL Server).