PrepAway - Latest Free Exam Questions & Answers

Which Transact-SQL 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 Transact-SQL statements should you run?

PrepAway - Latest Free Exam Questions & Answers

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’

2 Comments on “Which Transact-SQL statements should you run?

  1. Ferdinand says:

    Generally I do not learn post on blogs, but I would like to say that this write-up very compelled me to take a
    look at and do it! Your writing style has been amazed me.
    Thanks, quite great article.




    0



    0

Leave a Reply