0

如何在 SQL Server 数据库上设置计划作业,以检查警报条件,例如表列方差的变化,并在方差列中的数据在 10-15 范围内时执行发送电子邮件警报的 cmd

数据库表中的列将是动态的......用户必须能够动态选择和设置任何数据库表列的警报并检查警报条件

谢谢

4

1 回答 1

1

Variance is the square of the standard deviation, so you could:

if (select stddev(col1)*stddev(col1) from YourTable) > 0.15
    begin
    exec sp_send_dbmail ... 
    end

You can find instructions on how to configure DB mail here.

于 2012-09-12T08:32:05.580 回答