Application.RenameFolderOnDtsServer Method
Renames a folder on the specified instance of SQL Server.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public Sub RenameFolderOnDtsServer ( _
sParent As String, _
sOldName As String, _
sNewName As String, _
sServerName As String _
)
public void RenameFolderOnDtsServer (
string sParent,
string sOldName,
string sNewName,
string sServerName
)
public:
void RenameFolderOnDtsServer (
String^ sParent,
String^ sOldName,
String^ sNewName,
String^ sServerName
)
public void RenameFolderOnDtsServer (
String sParent,
String sOldName,
String sNewName,
String sServerName
)
public function RenameFolderOnDtsServer (
sParent : String,
sOldName : String,
sNewName : String,
sServerName : String
)
매개 변수
- sParent
The name of the parent folder.
- sOldName
The name of the existing folder.
- sNewName
The new name of the folder.
- sServerName
The name of the server where the folder is located.
예
The following code example creates a folder within the Integration Services services hierarchy, verifies that the folder has been created, renames it, verifies that the old name is still recognized as a folder, and then verifies whether the new folder name is found.
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
Sample Output:
Folder exists? True
Old, renamed folder exists? False
New folder exists? True
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
Application Class
Application Members
Microsoft.SqlServer.Dts.Runtime Namespace