Which TransactSQL statements should you run?

You have been tasked to delete a number of Database Mail messages that have been sent.
You need to delete all the emails that were sent more than one month ago.
Which TransactSQL
statements should you run?

You have been tasked to delete a number of Database Mail messages that have been sent.
You need to delete all the emails that were sent more than one month ago.
Which TransactSQL
statements should you run?

A.
DECLARE @OneMonthAgo datetime = DATEADD(mm,1,
GETDATE())
EXEC msdb.dbo.sysmail_delete_log_sp @OneMonthAgo

B.
DECLARE @OneMonthAgo datetime = DATEADD(mm,1,
GETDATE())
EXEC msdb.dbo.sysmail_delete_mailitems_sp @OneMonthAgo

C.
DECLARE @OneMonthAgo datetime = DATEADD(mm,1,
GETDATE())
EXEC msdb.dbo.sysmail_delete_log_sp @OneMonthAgo,’Success’

D.
DECLARE @OneMonthAgo datetime = DATEADD(mm,1,
GETDATE())
EXEC msdb.dbo.sysmail_delete_mailitems_sp @OneMonthAgo,’Sent’



Leave a Reply 0

Your email address will not be published. Required fields are marked *