다음을 통해 공유


ASExecuteDDLTask.Source 속성

정의

Analysis Services 서버로 보낼 DDL 문이 포함된 원본의 이름을 가져오거나 설정합니다.

public:
 property System::String ^ Source { System::String ^ get(); void set(System::String ^ value); };
public string Source { get; set; }
member this.Source : string with get, set
Public Property Source As String

속성 값

Analysis Services 서버로 보낼 DDL 문을 포함하는 원본의 이름입니다.

예제

다음 코드 샘플에서는 파일 연결에서 실행할 DDL 문을 로드하는 새 ASExecuteDDLTask 를 만들고 구성하고 실행합니다. 샘플에서는 속성을 사용합니다 Source .

using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.DataTransformationServices.Tasks.DTSProcessingTask;  

class Module1  
{  

  public static void Main()  
  {  

    Package pkg = new Package();  

    ConnectionManager asCM;  
    asCM = pkg.Connections.Add("MSOLAP100");  
    asCM.Name = "Analysis Services Connection Manager";  
    asCM.ConnectionString = "Data Source=<servername>;" +  
      "Initial Catalog=Adventure Works DW;Provider=MSOLAP;" +  
      "Integrated Security=SSPI;Impersonation Level=Impersonate;";  

    ConnectionManager cmdCM;  
    cmdCM = pkg.Connections.Add("FILE");  
    cmdCM.Name = "Command Source Connection Manager";  
    cmdCM.ConnectionString = "C:\\ddltest.txt";  

    Executable exe = pkg.Executables.Add("Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask, " +  
      "Microsoft.SqlServer.ASTasks, Version=10.0.0.0, " +  
      "Culture=neutral, PublicKeyToken=89845dcd8080cc91");  
    TaskHost thTask = (TaskHost) exe;  
    {  
      thTask.Properties("ConnectionName").SetValue(thTask, "Analysis Services Connection Manager");  
      thTask.Properties("SourceType").SetValue(thTask, DDLSourceType.FileConnection);  
      thTask.Properties("Source").SetValue(thTask, "Command Source Connection Manager");  
    }  

    DTSExecResult valResults = pkg.Validate(pkg.Connections, pkg.Variables, null, null);  

    if (valResults==DTSExecResult.Success)  
    {  
      pkg.Execute();  
    }  

  }  

}  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.DataTransformationServices.Tasks.DTSProcessingTask  

Module Module1  

  Sub Main()  

    Dim pkg As New Package  

    Dim asCM As ConnectionManager  
    asCM = pkg.Connections.Add("MSOLAP100")  
    asCM.Name = "Analysis Services Connection Manager"  
    asCM.ConnectionString = "Data Source=<servername>;" & _  
      "Initial Catalog=Adventure Works DW;Provider=MSOLAP;" & _  
      "Integrated Security=SSPI;Impersonation Level=Impersonate;"  

    Dim cmdCM As ConnectionManager  
    cmdCM = pkg.Connections.Add("FILE")  
    cmdCM.Name = "Command Source Connection Manager"  
    cmdCM.ConnectionString = "C:\ddltest.txt"  

    Dim exe As Executable = pkg.Executables.Add( _  
      "Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask, " & _  
      "Microsoft.SqlServer.ASTasks, Version=10.0.0.0, " & _  
      "Culture=neutral, PublicKeyToken=89845dcd8080cc91")  
    Dim thTask As TaskHost = CType(exe, TaskHost)  
    With thTask  
      .Properties("ConnectionName").SetValue(thTask, _  
        "Analysis Services Connection Manager")  
      .Properties("SourceType").SetValue(thTask, DDLSourceType.FileConnection)  
      .Properties("Source").SetValue(thTask, "Command Source Connection Manager")  
    End With  

    Dim valResults As DTSExecResult = pkg.Validate( _  
      pkg.Connections, pkg.Variables, Nothing, Nothing)  

    If valResults = DTSExecResult.Success Then  
      pkg.Execute()  
    End If  

  End Sub  

End Module  

설명

이 속성은 속성에서 SourceType 작동합니다. 원본 형식이 변수이고 변수가 null이면 반환된 가 String 비어 있습니다. 원본 형식이 연결이고 연결을 검색하는 동안 오류가 발생하면 반환된 가 String 비어 있습니다.

DDL 문은 XMLA , Alter또는 Delete 명령을 포함하는 XMLACreate(XML for Analysis) 문으로 다음 예제와 같은 형식으로 구성됩니다.

<Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">

<ParentObject>

<DatabaseID>Adventure Works DW</DatabaseID>

</ParentObject>

<ObjectDefinition>

<Dimension xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<ID>Dim Customer</ID>

<Name>Customer</Name>

<Annotations>

...

</Annotations>

<Source xsi:type="DataSourceViewBinding">

<DataSourceViewID>Adventure Works DW</DataSourceViewID>

</Source>

<Type>Customers</Type>

<Language>1033</Language>

<Collation>Latin1_General_CI_AS</Collation>

<UnknownMemberName>Unknown</UnknownMemberName>

<Translations>

...

</Translations>

<Attributes>

...

</Attributes>

...

</Dimension>

</ObjectDefinition>

</Create>

적용 대상