Partager via


Application.CreateFolderOnSqlServer Method

Creates a folder on the specified instance of SQL Server.

Espace de noms: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

Syntaxe

'Déclaration
Public Sub CreateFolderOnSqlServer ( _
    strParent As String, _
    strNewFolderName As String, _
    strServerName As String, _
    strServerUserName As String, _
    strServerPassword As String _
)
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
)
public void CreateFolderOnSqlServer (
    String strParent, 
    String strNewFolderName, 
    String strServerName, 
    String strServerUserName, 
    String strServerPassword
)
public function CreateFolderOnSqlServer (
    strParent : String, 
    strNewFolderName : String, 
    strServerName : String, 
    strServerUserName : String, 
    strServerPassword : String
)

Paramètres

  • strParent
    The name of the parent folder. If you want to create a folder under the File System node, use the CreateFolderOnDtsServer method.
  • strNewFolderName
    The name of the folder to create.
  • strServerName
    The name of the instance of SQL Server.
  • strServerUserName
    The user name to use when authenticating on the server.
  • strServerPassword
    The password associated with the strServerUserName account.

Notes

To verify that the folder was created, use the following Transact-SQL query, which selects all packages stored in the File System folder.

select * from sysdtspackagefolders90

Or, connect to the Integration Services server, expand Stored Packages, and then expand MSDB. The new folder that has the name given in strNewFolderName will be listed.

Exemple

The following code example shows how to create a new folder named myNewFolder. The folder is stored in the sysdtspackagefolders90 table in the SQL Servermsdb 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\90\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\90\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

Sécurité des threads

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

Application Class
Application Members
Microsoft.SqlServer.Dts.Runtime Namespace