SSIS:为​​什么这不记录? [英] SSIS: Why is this not logging?

查看:30
本文介绍了SSIS:为​​什么这不记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否有帮助,但我启用了日志记录到我的 C 驱动器上名为 test.txt 的文本文件.

I don't know if this will help, but i enabled logging to a text file called test.txt on my C Drive.

Public Sub Main()
    Dim rowsProcessed As Integer = 100
    Dim emptyBytes(0) As Byte

    Dts.Log("Testing, Test 1,2,3", rowsProcessed.ToString, emptyBytes)

    Dts.TaskResult = ScriptResults.Success
End Sub

推荐答案

你必须进入 SSIS->Logging 菜单并像一个疯狂的 checkbox-ticking-ninja 一样勾选复选框才能让它工作.

You have to go into the SSIS->Logging menu and tick checkboxes like a crazy checkbox-ticking-ninja to get this to work.

有各种复选框需要勾选,其中一些只有在你点击脚本任务时才会出现,所以我花了一段时间才弄明白:

There are various checkboxes that have to be checked, and some of them only appear when you click on the script tasks, so it took me a while to figure this out:

  • 首先,通过在提供者和日志"选项卡上勾选来启用您的日志记录提供者(您已经设置,对吗?).
  • 然后切换到详细信息"选项卡(显示您可能想要记录的各种事件)
  • 对于 DTS.Log() 方法,您需要 ScriptTaskLogEntry 事件,但它们仅在您单击左侧树中的 Script Tasks 时显示.
  • 因此,单击左侧树中的每个脚本任务,启用它以进行日志记录,然后在详细信息选项卡上勾选脚本任务事件.
  • 还要确保为每个脚本任务勾选您的日志记录提供程序
  • First, enable your logging provider (that you have set up, right?) by ticking it on the Providers and Logs tab.
  • Then switch to the Details tab (which shows various events that you might want to log)
  • For the DTS.Log() method you need the ScriptTaskLogEntry event, but they only show up when you click on Script Tasks in the tree on the left.
  • So, click each of your Script Tasks in the tree on the left, enable it for logging, and then tick the Script Tasks event on the details tab.
  • Also make sure your logging provider is ticked for each script task

另见:http://msdn.microsoft.com/en-us/library/ms136131.aspx

这篇关于SSIS:为​​什么这不记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆