Udostępnij przez


Metoda Application.CreateFolderOnDtsServer

Tworzy folder na serwerze, który pojawia się w węźle przechowywane pakiety Integration Services usługa hierarchii.

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Runtime
Zestaw:  Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)

Składnia

'Deklaracja
Public Sub CreateFolderOnDtsServer ( _
    sParent As String, _
    sNewFolderName As String, _
    sServerName As String _
)
'Użycie
Dim instance As Application
Dim sParent As String
Dim sNewFolderName As String
Dim sServerName As String

instance.CreateFolderOnDtsServer(sParent, _
    sNewFolderName, sServerName)
public void CreateFolderOnDtsServer(
    string sParent,
    string sNewFolderName,
    string sServerName
)
public:
void CreateFolderOnDtsServer(
    String^ sParent, 
    String^ sNewFolderName, 
    String^ sServerName
)
member CreateFolderOnDtsServer : 
        sParent:string * 
        sNewFolderName:string * 
        sServerName:string -> unit 
public function CreateFolderOnDtsServer(
    sParent : String, 
    sNewFolderName : String, 
    sServerName : String
)

Parametry

  • sParent
    Typ: System.String
    Nazwa folderu najwyższego poziom, aby zapisać ten folder w obszarze.
  • sNewFolderName
    Typ: System.String
    Nazwa do nowo utworzonego folderu.
  • sServerName
    Typ: System.String
    Nazwa serwera z systemem Integration Services usługa.

Uwagi

Aby zweryfikować, że folder został utworzony, poniższa kwerenda języka Transact-SQL wybiera wszystkie pakiety przechowywane w Systemu plików folder Przechowywane pakiety pakiet magazynu.

select * from sysssispackages

Aby wyświetlić listę folderów, można również połączyć Integration Services usługa, rozwiń węzeł Przechowywane pakiety, a następnie rozwiń węzeł Systemu plików.Nowy folder o nazwie podanej w strNewFolderName zostaną wyświetlone.

Uruchomić Integration Services usługa, otwórz Panelu sterowania, kliknij Narzędzia administracyjne, a następnie kliknij przycisk usług.Usług Otwiera przystawkę.Zlokalizuj sql Server Integration Services na liście usług kliknij prawym przyciskiem myszy sql Server Integration Services, a następnie kliknij przycisk Właściwościi wybierz Typ uruchomienia z ręcznie.Kliknij przycisk OK.Ponownie kliknij prawym przyciskiem myszy sql Server Integration Services, a następnie kliknij przycisk Start  

Przykłady

W poniższym przykładzie pokazano, jak utworzyć nowy folder MójFolder, w systemie plików.Aby wyświetlić folder po utworzeniu, otwórz SQL Server Management Studio, połącz się z Integration Services usługa, rozwiń węzeł magazynu pakiet pakiety przechowywane, a następnie rozwiń folder o nazwie myParentFolder.W przykładzie nowy folder jest tworzony w folderze istniejącego systemu plików.

class ApplicationTests
    {
        static void Main(string[] args)
        {
            Application app = new Application();
            Package p = app.LoadPackage(pkg, null);
    
            // Create a new folder named myFolder on the server named yourserver.
            String folder = "File System";
            String newName = "myFolder";
            String serverName = "yourserver";
            app.CreateFolderOnDtsServer(folder, newName, serverName);
        }
    }
Class ApplicationTests
        Sub Main(ByVal args() As String)
            Dim app As Application =  New Application() 
            Dim p As Package =  app.LoadPackage(pkg,Nothing) 
 
            ' Create a new folder named myFolder on the server named yourserver.
            Dim folder As String =  "File System" 
            Dim NewName As String =  "myFolder" 
            Dim serverName As String =  "yourserver" 
            app.CreateFolderOnDtsServer(folder, NewName, serverName)
        End Sub
End Class