SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Idea to simply inform Admin when values are found in SQL-Table by mail, maybe with Notify operator...


Idea to simply inform Admin when values are found in SQL-Table by mail, maybe with Notify operator task

Author
Message
ao 87344
ao 87344
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 56
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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search