SQL Server Integration Services(SSIS)中的脚本任务调试

脚本任务 ( Script Task )

In SQL Server Integration services (SSIS), it may not be possible to meet all the business requirements using built-in tasks. In these cases, we can achieve the functionality using C# or VB.net code in script task. The script task is an ideal alternative solution to built-in tasks.

在SQL Server集成服务(SSIS)中,使用内置任务可能无法满足所有业务要求。 在这些情况下,我们可以在脚本任务中使用C#或VB.net代码来实现该功能。 脚本任务是内置任务的理想替代解决方案。

脚本任务与脚本组件 ( Script Task Vs Script Component )

Both the Script Task and the Script component have the provision to extend the default functionality using C# or VB.Net. The script task is used in the control flow as a task. Whereas the script component has been used in the data flow as a source, destination or a transformation.

脚本任务和脚本组件都提供了使用C#或VB.Net扩展默认功能的规定。 脚本任务在控制流中用作任务。 而脚本组件已在数据流中用作源,目标或转换。

Following are few examples which describe the power of script task

以下是一些描述脚本任务功能的示例

  1. Querying Active Directory service Interface (AD) from SSIS to extract the list of membership groups for a given user id

    从SSIS查询Active Directory服务接口(AD),以提取给定用户ID的成员资格组列表
  2. Filter source data files based on a number of criteria (size of the file, date and contents of the file, etc.)

    根据许多条件(文件大小,日期和内容等)过滤源数据文件

Though there are many advantages of using the script task, it is usually undermined by the developers because of the complexity to debug and fix the issues.

尽管使用脚本任务有很多优点,但是由于调试和解决问题的复杂性,开发人员通常会破坏它。

脚本任务调试 ( Script Task Debugging )

In this blog post, I have consolidated a number of techniques to debug the script task. These debugging techniques have been classified into two groups.

在此博客文章中,我整合了许多调试脚本任务的技术。 这些调试技术已分为两类。

  • Design time debugging techniques

    设计时调试技术
  • Run time debugging techniques

    运行时调试技术

设计时调试 ( Design Time Debugging )

This method is suitable while you are developing a package. You will be using the SSDT to debug and investigate.

在开发软件包时,此方法适用。 您将使用SSDT进行调试和调查。

运行时调试 ( Run Time Debugging )

Run time analysis is useful, once the package has been deployed and scheduled to run at a specific time. In this case, you will not be able to use the SSDT to debug the package. Hence we need to use other alternative techniques to understand the procedure during execution.

一旦部署了该程序包并计划在特定时间运行该程序,运行时分析将很有用。 在这种情况下,您将无法使用SSDT调试软件包。 因此,我们需要使用其他替代技术来理解执行过程中的过程。

解决方案概述 ( Solution overview )

To explain multiple debugging facilities, I have created a sample SSIS package with one script task. This script task accept one user variable (Filecount).

为了解释多种调试功能,我创建了一个带有一个脚本任务的示例SSIS包。 此脚本任务接受一个用户变量(Filecount)。

The below mentioned image represents the sample package at high level.

下面的图像代表了高级样品包装。

Using this sample package, we will be exploring the debugging techniques. There are four debugging methods are available.

使用此样本包,我们将探索调试技术。 有四种调试方法可用。

  1. Using Message Box to
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值