This is a good compliment to the sql query active monitor. It will open a connection to a remote database first. If there are results it will then compose and e-mail and shoot it out to whom ever you specify in the variables at the top of the code.
Optionally you can update the table values returned as well. I use this to help automate some internal processes but there are many uses for such functionality in the hands of a creative scripter.