言語

Application.CreateFolderOnSqlServer メソッド

定義

指定されたSQL Serverインスタンスにフォルダを作成します。

public:
 void CreateFolderOnSqlServer(System::String ^ strParent, System::String ^ strNewFolderName, System::String ^ strServerName, System::String ^ strServerUserName, System::String ^ strServerPassword);
public void CreateFolderOnSqlServer(string strParent, string strNewFolderName, string strServerName, string strServerUserName, string strServerPassword);
member this.CreateFolderOnSqlServer : string * string * string * string * string -> unit
Public Sub CreateFolderOnSqlServer (strParent As String, strNewFolderName As String, strServerName As String, strServerUserName As String, strServerPassword As String)

パラメーター

strParent
String

親フォルダーの名前。 ファイルシステムノードの下にフォルダを作成したい場合は、 CreateFolderOnDtsServer(String, String, String) メソッドを使ってください。

strNewFolderName
String

作成するフォルダの名前。

strServerName
String

SQL Server のインスタンスの名前です。

strServerUserName
String

サーバー上で認証する際に使うユーザー名。

strServerPassword
String

パスワードは strServerUserName アカウントに関連付けられています。

以下のコード例は、myNewFolder.という名前の新しいフォルダを作成する方法を示しています。このフォルダはSQL Server msdbデータベースのsysssispackagefoldersテーブルに格納されます。

class ApplicationTests  
    {  
        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();  

            //Create a folder, myNewFolder, in the   
            // SQL Server msdb database.  
            app.CreateFolderOnSqlServer("\\", "myNewFolder", "yourserver", null, null);  
        }  
    }  
Class ApplicationTests  
        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()   

            'Create a folder, myNewFolder, in the   
            ' SQL Server msdb database.  
            app.CreateFolderOnSqlServer("\\", "myNewFolder", "yourserver", Nothing, Nothing)  
        End Sub  
End Class  

注釈

フォルダが作成されたことを検証するには、以下の Transact-SQL クエリを使い、ファイルシステムフォルダに保存されているすべてのパッケージを選択します。

select * from sysssispackagefolders

または、統合サービスサーバーに接続し、「 ストアドパッケージ」を展開し、さらに MSDBを展開する方法もあります。 strNewFolderNameで名前が付けられた新しいフォルダがリストに載ります。

適用対象