UPDATE ReportDefinition SET ReportAbandonTime = CASE WHEN @ReportStatus = '4' THEN GetDate() ELSE NULL END, ReportStatus = @ReportStatus WHERE (ReportID = @ReportID)