1 of 1 people found this helpful
This should take care of what you are looking for using the SQL server user experience monitor you were probably already basing the monitor on.
DECLARE @Names VARCHAR(8000)
SELECT @Names = COALESCE(@Names + ', ', '') + Name
FROM sys.databases where is_auto_create_stats_on = 0
SELECT COUNT(*), @names FROM sys.databases WHERE is_auto_create_stats_on = 0
Works like a charm!
Thank you so much.
We are trying to make a SQL statement that sends an email alert. Here is the statement that we have, that looks at a table for the value.
How do we set up an alert that will send an email when the value is greater than 0. We are stuck on the exact syntax to use in the statement. Also, how do you use the returned value to send the alert?