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 で指定されたパッケージが sServerName によって指定されたサーバー上に存在する場合、true、そうでなければ false となります。
例
以下のコード例は、親フォルダ 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