Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Deployed package execution in SSISDB shows success but write action never happened

$
0
0

I simplified the issue to a simple write action in C# script task, writing current time stamp into a text file located on the same machine inC:\test\, the directory has been granted full control to Everyone and NT Service\MsDtsServer130, NT Service\SQLSERVERAGENT. The environment is SQL Server 2016, Visual Studio 2015, and Windows Server 2016.

If create a SQL Server Agent job from file system, it updates the text file as expected. If deploy the package into SSISDB and execute, the execution report shows all success while the write action actually never happened. And I was not able to find any clue in system logs.

I will be very grateful to inputs on:

  • What might be wrong in this simple-write test; and
  • How to get more useful log information about this error and possibly other issues.

Code in the simple-write script task:

public void Main()
{
    Dts.TaskResult = (int)ScriptResults.Failure;
    try
    {
        // TODO: Add your code here
        using (var writer = new StreamWriter("C:\\test\\simple-write.txt", true, Encoding.Unicode))
        {
            writer.WriteLine(DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffffffK"));
            writer.Flush();
        }
        Dts.TaskResult = (int)ScriptResults.Success;

    }catch(Exception ex)
    {
        Dts.Events.FireError(0, "Simple-Write-Test", ex.ToString(), String.Empty, 0);
        Dts.TaskResult = (int)ScriptResults.Failure;
    }
}

** The catch block is supposed to fire an error if something goes wrong in the write action; but it was not triggered and task seems to be successful in execution report.



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>