Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
waja
Starting Member
6 Posts |
Posted - 2010-07-05 : 03:22:26
|
Hi,Is there a very simple way to setup a very simple notification routine like below:1. Everyday at a specific time2. Query one of my database table (count total record inside table)3. send out above result to an email address.Remarks:I'm using SQL server 2005 with windows server 2003.Thank you very much in advance.kind regardswaja |
|
beniaminus
Starting Member
21 Posts |
Posted - 2010-07-05 : 07:48:46
|
You could set up a new Maintenance Plan to execute a T-SQL script.In the script you would have to query the table and send the result using database mail. I think it uses an sp called sp_send_dbmail.You can find some info on database mail here: [url]http://msdn.microsoft.com/en-us/library/ms175887.aspx[/url]I hope this helpsBen :) |
|
|
waja
Starting Member
6 Posts |
Posted - 2010-07-05 : 18:22:07
|
Hi,Thank you very much for your help. will try out the method proposed by you.Kind regards.waja |
|
|
waja
Starting Member
6 Posts |
Posted - 2010-07-13 : 06:10:50
|
I try to create a maintenance plan and select 'email report' as report option. When i click on the email button, nothing happened....an error message appeared at the bottom window. There are no operators defined on the systemCan someone please advise.Kind regards.waja |
|
|
rdjabarov
Starting Member
8 Posts |
Posted - 2010-07-13 : 12:11:58
|
you need to set up an operator, and specify valid email address. You can be the oprator, or a specific distribution list, with just you in it. Then you can simply set up a scheduled task of T-SQL subsystem, where you would store the results of COUNT(*) operation into a variable, and then send as elaborate of a message to yourself as you want using sp_send_dbmail."The data in a record depends on the Key to the record, the Whole Key, and nothing but the Key, so help me Codd." |
|
|
waja
Starting Member
6 Posts |
Posted - 2010-07-13 : 12:22:08
|
Hi,Thanks for your help. so how and where do i setup this operator?Kind regards,waja |
|
|
|
|
|
|
|