다음을 통해 공유


Application.GetPackageInfos Method

Gets a PackageInfos collection that contains the packages stored in an instance of SQL Server, within the specified logical folder, by using the server name, user name, and password.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Function GetPackageInfos ( _
    strFolder As String, _
    serverName As String, _
    serverUserName As String, _
    serverPassword As String _
) As PackageInfos
public PackageInfos GetPackageInfos (
    string strFolder,
    string serverName,
    string serverUserName,
    string serverPassword
)
public:
PackageInfos^ GetPackageInfos (
    String^ strFolder, 
    String^ serverName, 
    String^ serverUserName, 
    String^ serverPassword
)
public PackageInfos GetPackageInfos (
    String strFolder, 
    String serverName, 
    String serverUserName, 
    String serverPassword
)
public function GetPackageInfos (
    strFolder : String, 
    serverName : String, 
    serverUserName : String, 
    serverPassword : String
) : PackageInfos

매개 변수

  • strFolder
    The logical folder that contains the packages you want to enumerate. If you want package information from the File System folder in the SSIS Package Store, use the GetDtsServerPackageInfos method. The logical folders in which packages are stored within MSDB can be created from the Stored Packages\MSDB node in Management Studio, by the dtutil.exe command prompt utility, or by the CreateFolderOnSqlServer method.
  • serverName
    The name of the SQL Server instance where the packages reside.
  • serverUserName
    The account name used to log on to the instance of SQL Server, if you need to log in to SQL Server using standard authentication. If you are using Windows Authentication, use null.
  • serverPassword
    The password of the user account, if you need to log in to SQL Server using standard authentication. If you are using Windows Authentication, use null.

반환 값

A PackageInfos collection.

주의

업데이트된 텍스트:2006년 7월 17일

This method bypasses the SSIS Service and connects directly to an instance of SQL Server to gather information about packages stored in the MSDB database. It returns a PackageInfo object for each package stored in the specified logical folder. From the PackageInfo object, you can obtain the package's name, description, creation date, version, and additional information.

For more information, see Managing Packages and Folders Programmatically.

The following code example retrieves the collection from the application object and iterates over each object in the collection, printing its description.

Application app = new Application();
PackageInfos pInfos = app.GetPackageInfos("\\", "yourserver", null, null);
foreach (PackageInfo pInfo in pInfos)
{
    Console.WriteLine("Name: {0}", pInfo.Name);
}
Dim app As Application =  New Application() 
Dim pInfos As PackageInfos =  app.GetPackageInfos("\\","yourserver",Nothing,Nothing) 
For Each pInfo As PackageInfo In pInfos
    Console.WriteLine("Name: {0}", pInfo.Name)
Next

Sample Output:

Name: Maintenance Plans

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

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