Which code segment should you use?

You have two tables named MainTable and ArchiveTable.
You need to move data older than 30 days from MainTable into ArchiveTable.
Which code segment should you use?
A. INSERT INTO ArchiveTable
SELECT *
FROM MainTable
WHERE RecordDate < DATEADD(D,-30,GETDATE())
B. DELETE FROM MainTable
OUTPUT
DELETED.* INTO ArchiveTable
WHERE RecordDate < DATEADD(D,-30,GETDATE())
C. DELETE FROM MainTable
OUTPUT deleted.*
WHERE RecordDate < DATEADD(D,-30,GETDATE())
D. INSERT INTO ArchiveTable
SELECT *
FROM MainTable
WHERE RecordDate < DATEADD(D,-30,GETDATE())
DELETE FROM MainTable

microsoft-exams

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.