7

I am a novice to SSIS. I have created a package with few Sequence Containers and few Tasks within them. The package will be scheduled to run automatically and thus I want capture the run time errors and status like number of rows inserted/updated/deleted to my own logging table in the SQL database.

I was thinking of using the SSIS Logging to SQL Server feature to log the entries to the default tables and then create a SQL Task to insert them into my own logging tables. Is that a good way to do it? Or do you suggest other better ways?

Also I couldnot get the SSIS logging to work properly. I found an online blog How to create an error log or custom error log within an SSIS Package? that describes the process to use SSIS logging to log entries to the SQL Server. However, unlike explained in the blog,

I cannot see either the dbo.sysssislog or dbo.sp_ssis_addlogentry tables created in my SQL Server database. What must I be doing wrong? Here are the steps I followed -

  1. Went to SSIS Logging
  2. Selected Provider Type as SQL Server
  3. Added the OLEDB connection for Configuration
  4. Went to the Detail tabs on each sequence container and chose appropriate events
  5. Clicked "Save..."
  6. Provided the location and name for the XML file
  7. Saved the package and ran it. Still cannot see those ssis table or procedure in the database. I am using SQL 2008R2.

Any suggestions and recommendations greatly appreciated.

Thanks in advance.

4

4 回答 4

11

查看列表中的#3。记下该数据库的位置。

在 SSMS 中导航到该数据库。展开数据库(单击左侧的加号)。

对于表位置:

展开文件夹。展开系统表文件夹。该表应该在那里可见。它的名字是dbo.sysssislog

对于程序位置:

展开可编程性文件夹。展开系统存储过程文件夹。存储过程应该是可见的。它的名字是dbo.sp_ssis_addlogentry

于 2013-01-04T20:15:21.933 回答
2

回覆。用户数据库中 sysssislog sys 表的可见性(在系统表文件夹内)。我已经使用“将事件的日志条目写入 SQL Server 数据库”设置了 SSIS 包(2008 R2)的日志记录,并指定了用户 DB。之后我运行了 SSIS 包。我在系统表文件夹中找到了 sysssislog(它包含预期的数据)。之后我决定测试这个表是“在每次运行 SSIS 包时创建的”。我删除了这张桌子。我再次运行 SSIS 包。表 sysssislog 确实是创建的(在用户表中),并且包含正确的数据,好的。

但是,从那以后我在 SSMS 的系统表中就看不到它了。换句话说,该表存在(例如存在于 sysobjects、systables 等中),但未显示在 SSMS 对象对象资源管理器的列表中。我知道这不是 SSIS 错误(SSIS 确实在每次运行时重新创建此表),但它是 SSMS 错误(它以某种方式丢失了此表的元数据)。

我多次删除此表并再次运行 SSIS 包,它确实是重新创建的,并且每次都重新填充上次运行的 SSIS 包中的数据。

但我从来没有能够在对象浏览器中看到它(当然我已经在任何级别刷新它,关闭/重新打开 SSMS - 由于任何原因,这个表从未出现过)。我能够在 MSDB 数据库中看到这个系统表(但它是空的)。

我重复为不同的数据库创建日志记录(为不同的数据库创建新连接)。SSIS 运行,创建了 sysssislog 表并且可以在系统表中看到(但是,再一次,如果我将删除此表,则在对象浏览器中重新创建时将不会再看到它)。

只是想分享,有趣的错误。MS QA 从未对此进行测试(在此表创建的第二个和后续实例中,来自 SSIS 的 SSMS 中表创建通知)。

阿列克谢

于 2013-10-31T17:31:32.340 回答
2

对于日志记录,我通常通过变量获取我想要的信息,然后在流程结束时,我执行了一个存储过程,它将记录插入到“ProjectLog”表中。不确定它是否理想,但它对我们有用。

原因:*错误消息可以自定义,因此可能更容易阅读和排除故障。*我们有带有自定义、易于理解的错误消息的“OnError”任务(例如,“流程未执行。文件 x 缺少 x 列/字段所需的数据”。*可以添加对您的组有价值的数据以满足业务需求.

*请注意,这是我们执行的附加步骤,除了带有每天覆盖的错误日志记录的文本文件。

于 2018-03-07T21:44:53.300 回答
1

即使您已启用 SSIS 日志记录,并且如果您尝试执行任务(不执行实际包),则不会在 msdb 或提到的连接管理器中创建 sysssislog 表。

于 2014-02-13T10:12:03.133 回答