Which code segment should you add to the Script task?

You are developing a Microsoft SQL Server Integration Service (SSIS) package. You enable the SSIS log provider for the Windows event log. You configure the package to use the ScriptTaskLogEntry event. You create a custom Script task.
You need to ensure that when the script completes, it writes the execution status to the event log on the server that hosts SSIS.
Which code segment should you add to the Script task?
A. System.Diagnostics.EventLog.WriteEntry("SSIS", "Script executed with return result" + ScriptResults.Success,
System.Diagnostics.EventLogEntrytype.Information)
B. System.Diagnostics.EventLog.WriteEntry("SSIS", "Script executed with return result" + Dts.TaskResult, System.Diagnostics.EventLogEntryType.Information)
C. Dts.TaskResult = (int)ScriptResults.Failure
D. Dts.Events.FireInformation(0, "SSIS", "Script executed with return result" + Dts.TaskResult, String.Empty, 0)

microsoft-exams

2 thoughts on “Which code segment should you add to the Script task?

  1. Right answer should be B, C would set the TaskResult to failure automatically and does not write to the event log.

Leave a Reply

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


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