Solved

SSIS: Check for Connection Manager Login Fail

Posted on 2014-04-23
2
543 Views
Last Modified: 2016-02-10
Hi Experts,

I have an SSIS package that runs on task scheduler everyday. The main thing is there is an OLE DB connection manager to an SQL server and it's been set on the server that this password must be updated every 3 months which of course causes a package failure.

Now. Is there a way I can somehow capture a login failure in this connection manager and use the send mail task to mail me when this happens? It's not as easy as using an event handler I don't think anyway...

Thanks,

OS
0
Comment
Question by:onesegun
2 Comments
 
LVL 8

Accepted Solution

by:
ProjectChampion earned 100 total points
ID: 40017468
There are several ways you can audit failed login attempts to SQL Server, but one way which sounds suitable for your specific case is xp_readerrorlog proc; for instance try the following:
DECLARE
  @StartTime DATETIME = GETDATE() - 100
, @EndTime DATETIME = GETDATE();
EXEC sys.xp_readerrorlog 0, 1, N'Login', N'failed', @starttime, @endtime;

You can modify the WHERE clause to filter the result specifically for the particular login that's used by your SSIS package.
Anyhow after detecting the failure you can use sp_send_dbmail or similar to send a notification to yourself.

Alternatively you can be proactive and check the login in the context of a separate job that runs more frequently or ahead of that SSIS package to allow you detect and resolve the problem before it affects your SSIS.

You can also use this method to proactively monitor all failed login attempts for all other logins (be it accidental or malicious) to stay on top of the game.
0
 

Author Closing Comment

by:onesegun
ID: 40020410
Thanks mate! Although it works and I can perhaps try to experiment with a way to pass some variables from the returned results into an SSIS variable and then perhaps use that to trigger a send mail task.

At the moment though I'm unable to execute sproc on the server of interest. Thanks anyway.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last 2 years, I have been working on SSIS 2008. Really the tough tasks in SSIS are to deploy packages and pass parameters (Values from outside package). The latter is certainly a headache for developers, particularly for me. We had to ma…
My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question