SSIS Retrieving Output Messages

Hi,

I am designing a simple SSIS package that tests database connectivity. To use the same connection for each database, I am changing the "InitialCatalog" property of the Connection Manager object to test each database in a server.

When the connection fails, I can capture a generic error message from the exception in a Try...Catch block, but it doesn't tell me why a connection attempt failed. I have tried Package Logging as well and that was actually less helpful.

I would have stopped there except the Output Window and Progress/Execution Results tabs BOTH show that the reason for the error was a login failure. I am trying to capture the message that appears in either of these windows as they are the most helpful.

Has anyone been able to programmatically capture these messages?

Thanks!!!

[1255 byte] By [ej_dba] at [2008-1-9]
# 1
ej_dba wrote:

Has anyone been able to programmatically capture these messages?

Thanks!!!

Package.Execute() is overloaded. There is an overload (http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.dtscontainer.execute.aspx) that takes an IDtsEvents interface which allows you to get at all the events (which are those messages that you see in the output window).

-Jamie

JamieThomson at 2007-10-2 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2

I may not completely understand the implementation of this method. Does this mean that I have to take a step back and call the SSIS package programmatically to get the benefit of capturing these messages?

EJ

ej_dba at 2007-10-2 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 3

Yes. Sorry, I thought that's what you meant.

If you're just executing a package normally (i.e. not programatically) then simply use a log provider and all the messages will be captured. Actually that's true if you were executing programatically as well.

-Jamie

JamieThomson at 2007-10-2 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 4

I turned on every logging event possible and nothing will tell me that there was a login failure. Only the Execution/Results/Progress tab will give that message.

I guess I'm stuck with my own messages...

Thanks for your reply, Jamie. I always learn something from your efforts and blog.

EJ

ej_dba at 2007-10-2 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified