开发者

How to check whether database mail is working or not?

开发者 https://www.devze.com 2023-02-02 22:53 出处:网络
H开发者_开发技巧ow can I conditionally check whether SQL Server Database Mail is working or not?

H开发者_开发技巧ow can I conditionally check whether SQL Server Database Mail is working or not?

Using EXEC msdb.dbo.sysmail_help_status_sp; we can check the status but I want to check the status conditionally like using If condition.


This stored procedure outputs table result with one value which refers to status. help is here That's what we know :)

You can use this result in .net code by retrieving this result set and checking value or in T-SQL code by putting result set in temporary table and checking value in it.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号