Share via


Application.CreateFolderOnSqlServer Método

Definição

Cria uma pasta na instância especificada do 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

O nome da pasta pai. Se você desejar criar uma pasta sob o nó Sistema de Arquivos, use o método CreateFolderOnDtsServer(String, String, String).

strNewFolderName
String

O nome da pasta a ser criada.

strServerName
String

O nome da instância do SQL Server.

strServerUserName
String

O nome de usuário a ser usado ao autenticar no servidor.

strServerPassword
String

A senha associada à conta strServerUserName.

Exemplos

O exemplo de código a seguir mostra como criar uma nova pasta chamada myNewFolder. A pasta é armazenada na tabela sysssispackagefolders no banco de dados 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  

Comentários

Para verificar se a pasta foi criada, use a seguinte consulta Transact-SQL, que seleciona todos os pacotes armazenados na pasta Sistema de Arquivos.

select * from sysssispackagefolders

Ou conecte-se ao servidor do Integration Services, expanda pacotes armazenados e expanda o MSDB. A nova pasta que tem o nome fornecido strNewFolderName será listada.

Aplica-se a