Solved

SSIS: Check for Connection Manager Login Fail

Posted on 2014-04-23
2
575 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

751 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