Share via


Application.CreateFolderOnSqlServer Método

Definición

Crea una carpeta en la instancia especificada 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)

Parámetros

strParent
String

Nombre de la carpeta principal. Si desea crear una carpeta en el nodo Sistema de archivos, utilice el método CreateFolderOnDtsServer(String, String, String).

strNewFolderName
String

Nombre de la carpeta que se va a crear.

strServerName
String

Nombre de la instancia de SQL Server.

strServerUserName
String

El nombre de usuario que se va a usar al autenticarse en el servidor.

strServerPassword
String

La contraseña asociada a la cuenta strServerUserName.

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear una nueva carpeta denominada myNewFolder. La carpeta se almacena en la tabla sysssispackagefolders de la base de datos msdb de 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  

Comentarios

Para comprobar que se creó la carpeta, use la siguiente consulta de Transact-SQL, que selecciona todos los paquetes almacenados en la carpeta Sistema de archivos.

select * from sysssispackagefolders

O bien, conéctese al servidor de Integration Services, expanda Paquetes almacenados y, a continuación, expanda MSDB. Se mostrará la nueva carpeta que tiene el nombre especificado en strNewFolderName .

Se aplica a