Application.ExistsOnDtsServer(String, String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Integration Services 서비스에 지정된 패키지가 이미 있는지 여부를 나타내는 부울 값을 반환합니다.
public:
bool ExistsOnDtsServer(System::String ^ sPackagePath, System::String ^ sServerName);
public bool ExistsOnDtsServer (string sPackagePath, string sServerName);
member this.ExistsOnDtsServer : string * string -> bool
Public Function ExistsOnDtsServer (sPackagePath As String, sServerName As String) As Boolean
매개 변수
- sPackagePath
- String
패키지의 정규화된 경로입니다.
- sServerName
- String
패키지를 검색할 서버의 이름입니다.
반환
지정한 sPackagePath 패키지가 이름이 지정된 서버에 있으면 true이고, 그렇지 않으면 false입니다 sServerName.
예제
다음 코드 예제에서는 부모 폴더 myFolder2아래의 파일 시스템에 저장되는 패키지를 보여 있습니다. 그런 다음 이 예제에서는 메서드를 사용하여 ExistsOnDtsServer 쿼리하여 패키지가 저장되었는지 확인합니다.
static void Main(string[] args)
{
// The variable pkg points to the location
// of the ExecuteProcess package sample
// that is installed with the SSIS samples.
string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";
Application app = new Application();
Package p = app.LoadPackage(pkg, null);
// Save the package under myFolder which is found under the
// File System folder on the DTS Service
app.SaveToDtsServer(p, null, @"File System\myFolder2", "yourserver");
// Verify that the package was saved by
// using ExistsOnDtsServer.
Boolean packageExists = app.ExistsOnDtsServer(@"File System\myFolder", "yourserver");
Console.WriteLine("Package exists? " + packageExists);
}
Sub Main(ByVal args() As String)
' The variable pkg points to the location
' of the ExecuteProcess package sample
' that is installed with the SSIS samples.
Dim pkg As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"
Dim app As Application = New Application()
Dim p As Package = app.LoadPackage(pkg,Nothing)
' Save the package under myFolder which is found under the
' File System folder on the DTS Service
app.SaveToDtsServer(p, Nothing, "File System\myFolder2", "yourserver")
' Verify that the package was saved by
' using ExistsOnDtsServer.
Dim packageExists As Boolean = app.ExistsOnDtsServer("File System\myFolder", "yourserver")
Console.WriteLine("Package exists? " + packageExists)
End Sub
샘플 출력:
Folder exists? True
Package exists? True
Folder exists? False