views:

34

answers:

1

i am not getting this store procedure , can you tell where is it "master..xp_sendmail"

i have send the mail when any insertion take place in particular table like "Emp"

+2  A: 

According to Microsoft you should not use xp_sendmail anymore. Use this instead:

http://msdn.microsoft.com/en-us/library/ms175887(v=SQL.90).aspx

As for the process of sending the emails... I would decouple the insert and the sending of the emails. You could have a SQL Server job that polls for new entries in a table and sends the emails if needed. This job could be sheduled to run every 5 minutes.

Note from MS:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. To send mail from SQL Server, use Database Mail.

EDIT: incorporated the usefull links from the comment of adolf garlic

http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/

http://www.databasejournal.com/features/mssql/article.php/3626056/Database-Mail-in-SQL-Server-2005.htm

Yves M.
http://www.databasejournal.com/features/mssql/article.php/3626056/Database-Mail-in-SQL-Server-2005.htm http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/ good old penil dave, he always cums up with the goods. etc.
adolf garlic