Drag OrderDesign and develop database solutions
Question 7. You need to meet the database performance requirements for maintenance data How should you complete the Transact-SQL code? To answer, drag the appropriate values to the correct targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:
A. CREATE TRIGGER dbo.trgMaintenanceEvents_Updatetimestamp ON dbo.MaintenanceEvents AFTER UPDATE AS BEGIN UPDATE m SET LastModifiedutc = SYSUTCDATETIME() FROM dbo.MaintenanceEvents m INNER JOIN inserted i ON m.MaintenanceId = i.MaintenanceId WHERE m.LastModifiedutc < i.LastModifiedutc END
B. CREATE TRIGGER dbo.trgMaintenanceEvents_Updatetimestamp ON dbo.MaintenanceEvents AFTER UPDATE AS BEGIN UPDATE m SET LastModifiedutc = GETUTCDATE() FROM dbo.MaintenanceEvents m INNER JOIN inserted i ON m.MaintenanceId = i.MaintenanceId END
C. CREATE TRIGGER dbo.trgMaintenanceEvents_Updatetimestamp ON dbo.MaintenanceEvents AFTER UPDATE AS BEGIN UPDATE m SET LastModifiedutc = SYSUTCDATETIME() FROM dbo.MaintenanceEvents m INNER JOIN deleted i ON m.MaintenanceId = i.MaintenanceId END
Explanation is locked. Start the demo or unlock full access to review explanations inside the protected test engine.