SQL Server Performance Forum – Threads Archive
Send mail reminderHi,
my scenario is that I have a table called pd_work that is used to set security on certain documents. I have a scheduled job which goes through this table and update the documents who need to set proper security(checking status in pd_work). But sometimes the Sql Server Agent is stopped and the job dosen’t go for a while and my table gets many rows. I want to send an e-mail when the rows in this table exceed for example 50 rows. I cannot use the Sql server agent to do this, since when this goes down, that’s when my troubles arrive with my table. I have read about SQL Mail, but haven’t got a clue of how to configure this yet. Does the server running sql server need to have an Outlook client? How to configure a mail profile? Is there an easy way of solving my problem? BTW: running SQL Server 2000 without SP’s. Exchange server available.
I cant help thinking that the easiest way to fix your problem, would be to ensure SQL agent doesnt get closed (not always possible), or at least, if it does get closed, to ensure that it is started back up again (there are options you can configure for this, see Advnaced tab in sql server agent properties). I dont fully understand how SQLMail would help you, but to answer your question, SQLMail needs a MAPI profile. The only reliable way ive found to create a MAPI profile is to install Outlook. There are documents on the web showing you how to install MAPI without outlook but Ive not had much luck with them. If none of these are attractive to you, my last idea would be an insert trigger on your table, which does a rowcount, and if greater than a certain threshold, it runs your job. But I would  NOT [/edit] recommend this method, especially as your real problem lies elsewhere.
That was certainly the easiest way to solve my problem. Was not aware of that setting…thanks!