• 相关软件
    >sp_tables_ex 创建者:webmaster 更新时间:2006-02-16 15:51

    返回有关指定链接服务器中表的表信息。



    语法


    [@table_server =] 'table_server'

        
    [ , [ @table_name = ] 'table_name' ]

        
    [ , [ @table_schema = ] 'table_schema' ]

        [ , [ @table_catalog = ] 'table_catalog' ]

        
    [ , [ @table_type = ] 'table_type' ]



    参数


    [@table_server =] 'table_server'



    链接服务器的名称,将为该服务器返回表信息。table_server 的数据类型为 sysname,无默认值。



    [ , [ @table_name = ] 'table_name' ]



    表的名称,将返回该表的数据类型信息。table_name 的数据类型为 sysname,默认值为 NULL。



    [@table_schema =] 'table_schema'



    表架构。table_schema 的数据类型为 sysname,默认值为 NULL。



    [@table_catalog =] 'table_catalog'



    指定 table_name 所在数据库的名称。table_catalog 的数据类型为 sysname,默认值为 NULL。



    [@table_type =] 'table_type'



    返回的表的类型。table_type 的数据类型为 sysname,默认值为 NULL,并可取下列某一个值。












































    描述
    ALIAS别名。
    GLOBAL TEMPORARY系统范围内可用的临时表名。
    LOCAL TEMPORARY只限当前任务可用的临时表名。
    SYNONYM同义词名。
    SYSTEM TABLE系统表名。
    TABLE用户表名。
    VIEW视图名。



    返回代码值




    结果集







































    列名数据类型描述
    TABLE_CATsysname表限定符名称。多种 DBMS 产品支持表的三部分命名方式 (qualifier.owner.name)。在 SQL Server 中,该列表示数据库名。在某些产品中,该列表示表所在数据库环境的服务器名。该字段可以为 NULL。
    TABLE_SCHEMsysname表所有者名称。在 SQL Server 中,该列表示创建表的数据库用户的姓名。该字段始终返回值。
    TABLE_NAMEsysname表名。该字段始终返回值。
    TABLE_TYPEvarchar(32)表、系统表或视图。
    REMARKSvarchar(254)SQL Server 不为该列返回值。



    注释


    执行 sp_tables_ex 时,将查询与 table_server 对应的 OLE DB 提供程序的 IDBSchemaRowset 接口的 TABLES 行集。table_nametable_schematable_catalogcolumn 参数传递到此接口,用以限制返回的行。



    如果指定的链接服务器的 OLE DB 提供程序不支持 IDBSchemaRowset 接口的 TABLES 行集,则 sp_tables_ex 返回一个空的结果集。



    权限


    执行权限默认授予 public 角色。



    示例


    下例返回链接服务器 LONDON2 pubs 数据库中的 titles 表的表信息。



    USE master
    EXEC sp_tables_ex 'LONDON2', 'titles', 'dbo', 'pubs', NULL
    相关文章
    本页查看次数: