Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Microsoft SQL Server 2000 Data Transformation Services- P11: Data Transformation Services in Microsoft SQL Server 2000 is a powerful tool for moving data. It’s easy to use, especially when you’re creating transformation packages with the DTS Wizard. But it’s also a flexible tool that you can customize to gain a high degree of control over the transformation of your data. | DTS Packages and Steps 476 Part V collection with the Add method. The PrecedenceBasis property is set to the execution result and the Value property indicates that failure is the result that is to trigger the precedence. Listing 24.1 This ActiveX Script Creates a New On Failure Precedence Constraint Option Explicit Function Main Dim pkg stpSource stpDestination prc Set pkg DTSGlobalVariables.Parent Set stpSource pkg.Steps stpBulkInsert Set stpDestination pkg.Steps stpInsertCustomer Set prc stpDestination.PrecedenceConstraints.New stpSource.Name prc.PrecedenceBasis DTSStepPrecedenceBasis_ExecResult prc.Value DTSStepExecResult_Failure stpDestination.PrecedenceConstraints.Add prc Main DTSTaskExecResult_Success End Function Note If you create a precedence constraint with this code in an ActiveX Script task the constraint will be in effect but will not be displayed in the Package Designer. In order for it to be displayed you have to open the Workflow Properties dialog for the step and click OK. The Execution Status of the Step Steps execute when all of their precedence constraints have been met and the step has a status of DTSStepExecStat_Waiting. If the step has any other status it will not be executed. You can change the execution of a step by setting the ExecutionStatus property of the Step object in code 477 Steps and Precedence Constraints Chapter 24 If a step has already been executed and you then set the Executionstatus property to DTSStepExecStat_Waiting the step will be executed again. If a step is waiting to be executed and you set the ExecutionStatus to any of the constants listed in Table 24.2 besides DTSStepExecStat_Waiting the step will not be executed. The status that makes the most sense to use for this purpose is DTSStepExecStat_Inactive. Note The ExecutionStatus property of the Step object is listed as a read-only property in the DTS Reference in Books Online. But there is a sample ActiveX script in Books Online that sets the property to .