Поделиться через


Метод CreateFolderOnSqlServer

Creates a folder on the specified instance of SQL Server.

Пространство имен:  Microsoft.SqlServer.Dts.Runtime
Сборка:  Microsoft.SqlServer.ManagedDTS (в Microsoft.SqlServer.ManagedDTS.dll)

Синтаксис

'Декларация
Public Sub CreateFolderOnSqlServer ( _
    strParent As String, _
    strNewFolderName As String, _
    strServerName As String, _
    strServerUserName As String, _
    strServerPassword As String _
)
'Применение
Dim instance As Application
Dim strParent As String
Dim strNewFolderName As String
Dim strServerName As String
Dim strServerUserName As String
Dim strServerPassword As String

instance.CreateFolderOnSqlServer(strParent, _
    strNewFolderName, strServerName, _
    strServerUserName, 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
)
member CreateFolderOnSqlServer : 
        strParent:string * 
        strNewFolderName:string * 
        strServerName:string * 
        strServerUserName:string * 
        strServerPassword:string -> unit 
public function CreateFolderOnSqlServer(
    strParent : String, 
    strNewFolderName : String, 
    strServerName : String, 
    strServerUserName : String, 
    strServerPassword : String
)

Параметры

  • strServerUserName
    Тип: System. . :: . .String
    The SQL Server login name if you use SQL Server Authentication to log into the server; otherwise, nullNothingnullptrunitпустая ссылка (Nothing в Visual Basic) if you use Windows Authentication.
  • strServerPassword
    Тип: System. . :: . .String
    The SQL Server login password if you use SQL Server Authentication to log into the server; otherwise, nullNothingnullptrunitпустая ссылка (Nothing в Visual Basic) if you use Windows Authentication.

Замечания

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 sysssispackagefolders

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.

Примеры

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