Hello,
I want to remove records from the database automatically, BUT it is very important for me to know (email) if there were records or not and how many are affected by the automatic task...
My job is scheduled to run every day and does something like:
DELETE from RadioactiveMaterials
WHERE (NotExplosive = true)
SET @.rowcount_var = @.@.ROWCOUNT
I would like to get detail on the deleted records, how can I produce the email?
If you are using SQL 2005, using Books Online, refer to the Topic: 'Database Mail How-to Topics'.
If you are using SQL 2000, I suggest that you check out xp_smtp_mail from here. Most folks will recommend NOT to use MAPI mail on a SQL Server.
|||
Arnie Rowland wrote:
If you are using SQL 2005, using Books Online, refer to the Topic: 'Database Mail How-to Topics'.
Database Mail How-to Topics:
http://msdn2.microsoft.com/en-us/library/ms188298.aspx
Paul A. Mestemaker II
Program Manager
Microsoft SQL Server Manageability
http://blogs.msdn.com/sqlrem/
No comments:
Post a Comment