BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting SQL Server DTS Error information via COM interface

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
David Clegg
Guest





PostPosted: Tue Sep 09, 2003 12:52 am    Post subject: Getting SQL Server DTS Error information via COM interface Reply with quote



I am automating SQL Server 2000 DTS Packages using the exposed COM
interface, but am having problems getting all the information if a DTS step
fails due to an error. I have implemented the OnError event for the
package, which is meant to return the information regarding the error, but
the information in the Description parameter is less verbose than the error
which is returned if the package is run via the DTS Designer in Enterprise
Manager.

For example, if I have a package with a step that fails due to a Primary
Key Constraint Error, DTS Designer says...
"The task reported failure on execution. The statement has been terminated.
Violation of PRIMARY KEY constraint 'PK_Operator'. Cannot insert duplicate
key in object 'Operator'."

COM fires two error events saying...
"The task reported failure on execution."
followed by
"Error at Destination for Row number 8. Errors encountered so far in this
task: 1."

I even tried calling GetExecutionErrorInfo for the failed step, but this
returns the same information.

I have tried googling for a solution to this, but the best I could come up
with was mention that there were bugs in SQL Server 7.0 which prevented the
complete error description being exposed. This was fixed in a SP, so I
would have assumed the fix would also have been present in SQL Server 2000.
Does anyone here have more experience or insight into this?

--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com

{$IFDEF Alessandro}Italian{$ELSE}French{$ENDIF} is the language of love.
For everything else there's Delphi^h^h^h^h^h^h C#.

Back to top
David Clegg
Guest





PostPosted: Wed Sep 10, 2003 4:17 am    Post subject: Re: Getting SQL Server DTS Error information via COM interfa Reply with quote



Brian Bushay TeamB <BBushay (AT) Nmpls (DOT) com> wrote in
news:pd5tlvolqjjg9e87vl8sqtirg1clrv42un (AT) 4ax (DOT) com:


Quote:
That is good as DTS error get.
Translation you are trying to insert a record into a table with a key
value that already exists. The record that causes the problem is the
8th record in the table you are trying to add from.

Sorry, I don't think I made my problem clear.

DTS Designer says "The task reported failure on execution. The statement
has been terminated. Violation of PRIMARY KEY constraint 'PK_Operator'.
Cannot insert duplicate key in object 'Operator'."

COM says "Error at Destination for Row number 8. Errors encountered so far
in this task: 1"
COM then says "The task reported failure on execution."

I want COM to also advise me the nature of the failure (in this case the
primary key constraint violation). The DTS Designer provides this
information, but I don't seem to be able to get the DTS COM interface to do
so.


--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com

{$IFDEF Alessandro}Italian{$ELSE}French{$ENDIF} is the language of love.
For everything else there's Delphi^h^h^h^h^h^h C#.

Back to top
David Clegg
Guest





PostPosted: Sun Sep 14, 2003 11:00 pm    Post subject: Re: Getting SQL Server DTS Error information via COM interfa Reply with quote



Brian Bushay TeamB <BBushay (AT) Nmpls (DOT) com> wrote in
news:m822mvkd6167mm48hl8926h071hbqchmh5 (AT) 4ax (DOT) com:

Quote:
maybe this document will help you
http://support.microsoft.com/default.aspx?scid=kb;en-us;240221

Thanks Brian. I had actually stumbled across this one myself, and tried the
steps outlined, but the error message was still less verbose that the DTS
Designer. I may just have to live with the limitation, and it shouldn't
impact too much on what I am attempting to achieve.

--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com

{$IFDEF Alessandro}Italian{$ELSE}French{$ENDIF} is the language of love.
For everything else there's Delphi^h^h^h^h^h^h C#.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.