Metoda Application.CreateFolderOnSqlServer
Tworzy folder na wystąpienie określonego SQL Server.
Przestrzeń nazw: Microsoft.SqlServer.Dts.Runtime
Zestaw: Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)
Składnia
'Deklaracja
Public Sub CreateFolderOnSqlServer ( _
strParent As String, _
strNewFolderName As String, _
strServerName As String, _
strServerUserName As String, _
strServerPassword As String _
)
'Użycie
Dim instance As Application
Dim strParent As String
Dim strNewFolderName As String
Dim strServerName As String
Dim strServerUserName As String
Dim strServerPassword As String
instance.CreateFolderOnSqlServer(strParent, _
strNewFolderName, strServerName, _
strServerUserName, strServerPassword)
public void CreateFolderOnSqlServer(
string strParent,
string strNewFolderName,
string strServerName,
string strServerUserName,
string strServerPassword
)
public:
void CreateFolderOnSqlServer(
String^ strParent,
String^ strNewFolderName,
String^ strServerName,
String^ strServerUserName,
String^ strServerPassword
)
member CreateFolderOnSqlServer :
strParent:string *
strNewFolderName:string *
strServerName:string *
strServerUserName:string *
strServerPassword:string -> unit
public function CreateFolderOnSqlServer(
strParent : String,
strNewFolderName : String,
strServerName : String,
strServerUserName : String,
strServerPassword : String
)
Parametry
- strParent
Typ: System.String
Nazwa folderu nadrzędnego.Jeśli chcesz utworzyć folder w obszarze węzła systemu plików, użyj CreateFolderOnDtsServer metoda.
- strNewFolderName
Typ: System.String
Nazwa folderu, aby utworzyć.
- strServerName
Typ: System.String
Nazwa wystąpienie SQL Server.
- strServerUserName
Typ: System.String
SQL Server Nazwę logowania, jeśli używasz SQL Server uwierzytelniania, aby zalogować się do serwera; w przeciwnym razie nullodwołanie o wartości null (Nothing w języku Visual Basic) korzystania z uwierzytelniania systemu Windows.
- strServerPassword
Typ: System.String
SQL Server Hasło logowania, jeśli używasz SQL Server uwierzytelniania, aby zalogować się do serwera; w przeciwnym razie nullodwołanie o wartości null (Nothing w języku Visual Basic) korzystania z uwierzytelniania systemu Windows.
Uwagi
Aby zweryfikować, że folder został utworzony, należy użyć kwerendy języka Transact-SQL następujące wybiera wszystkie pakiety przechowywane w folderze systemu plików.
select * from sysssispackagefolders
Lub połącz się z Integration Services serwera, rozwiń Przechowywane pakiety, a następnie rozwiń węzeł MSDB.Nowy folder o nazwie podanej w strNewFolderName zostaną wyświetlone.
Przykłady
The following code example shows how to create a new folder named myNewFolder. The folder is stored in the sysssispackagefolders table in the SQL Server msdb database.
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