Aracılığıyla paylaş


Application.CreateFolderOnSqlServer Yöntemi

Belirtilen örnek üzerinde bir klasör oluşturur SQL Server.

Ad Alanı:  Microsoft.SqlServer.Dts.Runtime
Derleme:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS içinde.dll)

Sözdizimi

'Bildirim
Public Sub CreateFolderOnSqlServer ( _
    strParent As String, _
    strNewFolderName As String, _
    strServerName As String, _
    strServerUserName As String, _
    strServerPassword As String _
)
'Kullanım
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
)

Parametreler

  • strNewFolderName
    Tür: System.String
    Oluşturmak istediğiniz klasörü adı.
  • strServerUserName
    Tür: System.String
    SQL Server Oturum açma adı kullanırsanız SQL Server ; sunucuya oturum açmak için kimlik doğrulama Aksi takdirde, nullnull başvuru (Visual Basic'te Nothing) , Windows kimlik doğrulaması kullanıyorsanız.
  • strServerPassword
    Tür: System.String
    SQL Server Oturum açma parolası kullanırsanız SQL Server ; sunucuda oturum kimlik doğrulaması Aksi takdirde, nullnull başvuru (Visual Basic'te Nothing) , Windows kimlik doğrulaması kullanıyorsanız.

Açıklamalar

Klasörü oluşturulduğunu doğrulamak için dosya sistem klasöründe depolanan tüm paketleri seçer aşağıdaki Transact-sql sorgusu kullanın.

select * from sysssispackagefolders

Ya bağlanmak Integration Services server ' ı genişletin Depolanan paketlerive sonra msdb.Verilen ada sahip yeni bir klasör strNewFolderName listelenecektir.

Örnekler

Aşağıdaki kod örneği adlı yeni bir klasör oluşturmak nasıl gösterirmyNewFolder. 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