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.
精彩评论