ScriptObjectModel 클래스

정의

스크립트 작업 개발자가 패키지 내에서 정의된 객체에 대해 전역 Dts 객체를 통해 프로그래밍 접근 권한을 부여합니다. Dts 객체는 클래스의 ScriptObjectModel 인스턴스입니다.

public ref class ScriptObjectModel
public class ScriptObjectModel
type ScriptObjectModel = class
Public Class ScriptObjectModel
상속
ScriptObjectModel

예제

스크립트 작업 내에서 사용되는 다음 코드 샘플은 , Events, 속성 TaskResultVariables사용법을 보여줍니다. 자세한 내용은 스크립트 작업을 이용한 Active Directory 쿼리를 참조하세요.

Public Sub Main()  

    Dim directory As DirectoryServices.DirectorySearcher  
    Dim result As DirectoryServices.SearchResult  
    Dim email As String  

    email = Dts.Variables("email").Value.ToString  

    Try  
        directory = New _  
            DirectoryServices.DirectorySearcher("(mail=" & email & ")")  
        result = directory.FindOne  
        Dts.Variables("name").Value = _  
            result.Properties("displayname").ToString  
        Dts.Variables("title").Value = _  
            result.Properties("title").ToString  
        Dts.TaskResult = ScriptResults.Success  
    Catch ex As Exception  
        Dts.Events.FireError(0, _  
            "Script Task Example", _  
            ex.Message & ControlChars.CrLf & ex.StackTrace, _  
            String.Empty, 0)  
        Dts.TaskResult = ScriptResults.Failure  
    End Try  

End Sub  

설명

Microsoft Visual Studio Tools for Applications(VSTA) 스크립팅 환경 내에서 스크립트 작업은 전역 Dts 객체를 제공하여, 개발자가 클래스의 ScriptObjectModel 속성과 메서드를 통해 패키지 내 다른 곳에 정의된 연결, 변수, 이벤트 등 객체에 프로그래밍 접근을 할 수 있게 합니다. 객체는 Dts 클래스의 ScriptObjectModel 인스턴스입니다.

속성

Name Description
Connections

스크립트 태스크가 포함된 패키지에 정의된 기존 연결 모음을 Connections 반환합니다.

Events

스크립트 작업을 포함하는 패키지에 정의된 기존 이벤트 모음을 IDTSComponentEvents 반환합니다.

ExecutionValue

작업 실행 결과에 대한 추가 정보를 제공하는 사용자 정의 객체를 받거나 설정합니다.

TaskResult

스크립트 작업을 반환 DTSExecResult 합니다.

Transaction

스크립트 작업의 컨테이너와 연관된 트랜잭션을 반환합니다.

VariableDispenser

스크립트 작업 내에서 기존 변수를 다룰 수 있는 것을 반환 VariableDispenser 합니다.

Variables

스크립트 작업을 포함하는 패키지에 정의된 기존 변수들의 집합을 Variables 반환합니다.

메서드

Name Description
Log(String, Int32, Byte[])

활성화된 모든 로그 제공자에 항목을 기록합니다.

적용 대상