共用方式為


LinkedServer.EnumTables Method (String, String)

Enumerates a list of tables that are available on the linked server for a specified table name and schema.

命名空間: Microsoft.SqlServer.Management.Smo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

語法

'宣告
Public Function EnumTables ( _
    tableName As String, _
    schemaName As String _
) As DataTable
public DataTable EnumTables (
    string tableName,
    string schemaName
)
public:
DataTable^ EnumTables (
    String^ tableName, 
    String^ schemaName
)
public DataTable EnumTables (
    String tableName, 
    String schemaName
)
public function EnumTables (
    tableName : String, 
    schemaName : String
) : DataTable

參數

  • tableName
    A String value that specifies the name of the table.
  • schemaName
    A String value that specifies the name of the schema.

傳回值

A DataTable object value that contains a list of tables that can be accessed on the linked server. The table describes the different columns of the returned DataTable.

Column

Data type

Description

TABLE_CAT

String

The table qualifier name. Various DBMS products support three-part naming for tables (qualifier.owner.name). In SQL Server 2005, this column represents the database name. In some other products, it represents the server name of the database environment of the table. This field can be NULL.

TABLE_SCHEM

String

The owner of the table in the linked server. In SQL Server, this column represents the name of the database user who created the table. This field always returns a value.

TABLE_NAME

String

The name of the table in the linked server. This field always returns a value.

TABLE_TYPE

String

The type of table: table, system table, or view.

REMARKS

String

SQL Server does not return a value for this column.

備註

只有 Microsoft .NET Framework 2.0 版支援此命名空間、類別或成員。

範例

How to: Link to an OLE-DB Provider Server in Visual Basic .NET

執行緒安全性

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 的硬體和軟體需求>。

請參閱

參考

LinkedServer Class
LinkedServer Members
Microsoft.SqlServer.Management.Smo Namespace

其他資源

Using Linked Servers in SMO
連結伺服器
sp_addlinkedserver (Transact-SQL)
sp_tables_ex (Transact-SQL)