PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

A.
DELETE FROM MainTable
OUTPUT deleted.* WHERE RecordDate < DATEADD(D,-30,GETDATE())

B.
DELETE FROM MainTable
OUTPUT DELETED.* INTO ArchiveTable WHERE RecordDate < DATEADD(D,-30,GETDATE())

C.
INSERT INTO ArchiveTable SELECT * FROM MainTable WHERE RecordDate < DATEADD(D,-30,GETDATE())

D.
INSERT INTO ArchiveTable SELECT * FROM MainTable WHERE RecordDate < DATEADD(D,-30,GETDATE())
DELETE FROM MainTable


Leave a Reply