You may want to be alerted when either a performance aspect of SQL Server that is not covered by existing miniDBA alerts or a condition in your application's database is met. This is where custom sql alerts can help you.
They run SQL that you define which returns either a boolean or numeric value. This query is run every minute and will raise the alert if a condition you specifiy is met.
Clicking the "Create Custom SQL Alert" button on the alert configuration screen will open the custom sql alert window.
The options and description tabs are the same as a regular alert - allowing setting thresholds, enabling sending emails and writing to the Windows event log etc.
The Custom SQL
tab allows you to give your new alert a name, specify if it is returning a boolean or numeric value and set the SQL itself.
You can hit the "Test SQL" button to immediately run the query on the current servers connection.
Don't forget that you can potentially lock items in the database so using "NOLOCK" SQL statements and any other technique to avoid locking your application is strongly advised.