Application.CreateFolderOnSqlServer Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Crea una cartella nell'istanza specificata di 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)
Parametri
- strParent
- String
Nome della cartella padre. Per creare una cartella nel nodo File system, utilizzare il metodo CreateFolderOnDtsServer(String, String, String).
- strNewFolderName
- String
Nome della cartella da creare.
- strServerName
- String
Nome dell'istanza di SQL Server.
- strServerUserName
- String
Nome utente da utilizzare durante l'autenticazione nel server.
- strServerPassword
- String
Password associata all'account strServerUserName.
Esempio
Nell'esempio di codice seguente viene illustrato come creare una nuova cartella denominata myNewFolder. The folder viene archiviata nella tabella sysssispackagefolders nel database msdb SQL Server.
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
Commenti
Per verificare che la cartella sia stata creata, usare la query Transact-SQL seguente, che seleziona tutti i pacchetti archiviati nella cartella File System.
select * from sysssispackagefolders
In alternativa, connettersi al server Integration Services, espandere Pacchetti archiviati e quindi espandere MSDB. Verrà elencata la nuova cartella con il nome specificato in strNewFolderName .