RenameFolderOnDtsServer メソッド

指定した SQL Server のインスタンスでフォルダーの名前を変更します。

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
Public Sub RenameFolderOnDtsServer ( _
    sParent As String, _
    sOldName As String, _
    sNewName As String, _
    sServerName As String _
)
'使用
Dim instance As Application
Dim sParent As String
Dim sOldName As String
Dim sNewName As String
Dim sServerName As String

instance.RenameFolderOnDtsServer(sParent, _
    sOldName, sNewName, sServerName)
public void RenameFolderOnDtsServer(
    string sParent,
    string sOldName,
    string sNewName,
    string sServerName
)
public:
void RenameFolderOnDtsServer(
    String^ sParent, 
    String^ sOldName, 
    String^ sNewName, 
    String^ sServerName
)
member RenameFolderOnDtsServer : 
        sParent:string * 
        sOldName:string * 
        sNewName:string * 
        sServerName:string -> unit 
public function RenameFolderOnDtsServer(
    sParent : String, 
    sOldName : String, 
    sNewName : String, 
    sServerName : String
)

パラメーター

使用例

次のコード例では、Integration Services サービス階層内にフォルダーを作成します。次に、そのフォルダーが作成されたことを確認してから、その名前を変更します。次に、古い名前がまだフォルダーとして認識されているかどうかを確認してから、新しいフォルダー名が検出されるかどうかを確認します。

static void Main(string[] args)
        {
            // Create a folder named myOldFolder.
            Application app = new Application();
            app.CreateFolderOnDtsServer(@"\File System\", "myOldFolder", "yourserver");

            // Verify that creation was successful.
            Boolean folderExists = app.FolderExistsOnDtsServer(@"File System\myOldFolder", "yourserver");
            Console.WriteLine("Folder exists? " + folderExists);

            // Rename myOldFolder to myNewFolder.
            app.RenameFolderOnDtsServer(@"File System", "myOldFolder", "myNewFolder", "yourserver");

            // Verify that the old folder still exists.
            folderExists = app.FolderExistsOnDtsServer(@"File System\myOldFolder", "yourserver");
            Console.WriteLine("Old, renamed folder exists? " + folderExists);

            // Verify that the folder exists with the new name. 
            folderExists = app.FolderExistsOnDtsServer(@"File System\myNewFolder", "yourserver");
            Console.WriteLine("New folder exists? " + folderExists);
        }
Shared  Sub Main(ByVal args() As String)
    ' Create a folder named myOldFolder.
    Dim app As Application =  New Application() 
    app.CreateFolderOnDtsServer("\File System\", "myOldFolder", "yourserver")
 
    ' Verify that creation was successful.
    Dim folderExists As Boolean =  app.FolderExistsOnDtsServer("File System\myOldFolder","yourserver") 
    Console.WriteLine("Folder exists? " + folderExists)
 
    ' Rename myOldFolder to myNewFolder.
    app.RenameFolderOnDtsServer("File System", "myOldFolder", "myNewFolder", "yourserver")
 
    ' Check if the old folder still exists.
    folderExists = app.FolderExistsOnDtsServer("File System\myOldFolder", "yourserver")
    Console.WriteLine("Old, renamed folder exists? " + folderExists)
 
    ' Verify that the folder exists with the new name. 
    folderExists = app.FolderExistsOnDtsServer("File System\myNewFolder", "yourserver")
    Console.WriteLine("New folder exists? " + folderExists)
End Sub

サンプルの出力 :

Folder exists?True

Old, renamed folder exists?False

New folder exists?True