Application.CreateFolderOnSqlServer Méthode

Définition

Crée un dossier dans l'instance spécifiée de 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)

Paramètres

strParent
String

Nom du dossier parent. Si vous souhaitez créer un dossier sous le nœud Système de fichiers, utilisez la méthode CreateFolderOnDtsServer(String, String, String).

strNewFolderName
String

Nom du dossier à créer.

strServerName
String

Nom de l'instance de SQL Server.

strServerUserName
String

Nom d'utilisateur à utiliser lors de l'authentification sur le serveur.

strServerPassword
String

Mot de passe associé au compte strServerUserName.

Exemples

L’exemple de code suivant montre comment créer un dossier nommé myNewFolder. Le dossier est stocké dans la table sysssispackagefolders de la base de données SQL Server msdb.

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  

Remarques

Pour vérifier que le dossier a été créé, utilisez la requête Transact-SQL suivante, qui sélectionne tous les packages stockés dans le dossier Système de fichiers.

select * from sysssispackagefolders

Ou, connectez-vous au serveur Integration Services, développez Packages stockés, puis développez MSDB. Le nouveau dossier dont le nom est indiqué strNewFolderName est répertorié.

S’applique à