Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Idea to simply inform Admin when values are found in SQL-Table by mail, maybe with Notify operator task Expand / Collapse
Author
Message
Posted Thursday, April 3, 2014 2:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 9, 2014 9:26 AM
Points: 2, Visits: 25
Hello,
I have found some situations, where values appear in Column NDF_STATUS in database table NDF_AUFTRAG. This can be normal. It is only critical, when these values exceed a limit I_MAXERRORS. I would like to inform the admin of the application, using this table by mail. He is the one who also gets other notifications when e.g. the database backup has failed, so an operator is available.
My idea was to check each hour (is enough) if there are more than I_MAXERRORS data rows with criteria:

I have a function giving me the test-result:

CREATE FUNCTION [dbo].[ERROR_IN_NDF_AUFTRAG] ( )
RETURNS int
AS
BEGIN
declare @I_COUNT_ERRORS as int
declare @I_MAXERRORS as int=5

set @I_COUNT_ERRORS =
(select Count (*) from NDF_AUFTRAG
where
NDF_STATUS between 1 and 9)
if @I_COUNT_ERRORS<@I_MAXERRORS
begin
return 0
end
return 1
END

Do you see a simple way to do this?
Post #1558260
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse