Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SSIS: Check for Connection Manager Login Fail

Posted on 2014-04-23
2
Medium Priority
?
597 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 300 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

705 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