.. _sql_server_types(SQLServer):

sys.types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sys.types视图记录kingbaseES中所有可以在表、函数或PROCEDURE中使用的类型及SHELL类型的源信息，每个类型在该视图中对应一行。


.. table:: sys.types 列
      :widths: 3 2 4
      :class: longtable
   
      +-------------------+----------------+--------------------------+
      | 名称              | 数据类型       | 描述                     |
      +===================+================+==========================+
      | name              | nvarchar(128)  | 类型的名称               |
      +-------------------+----------------+--------------------------+
      | system_type_id    | oid            | 类型对应基类型的OID      |
      +-------------------+----------------+--------------------------+
      | user_type_id      | oid            | 类型的 OID               |
      +-------------------+----------------+--------------------------+
      | schema_id         | oid            | 类型所属命名空间的OID    |
      +-------------------+----------------+--------------------------+
      | principal_id      | oid            | 类型拥有者的OID          |
      +-------------------+----------------+--------------------------+
      | max_length        | smallint       | 类型的最大字节长度       |
      +-------------------+----------------+--------------------------+
      | precision         | tinyint        | 类型的最大精度           |
      +-------------------+----------------+--------------------------+
      | scale             | tinyint        | 类型的最大标度           |
      +-------------------+----------------+--------------------------+
      | collation_name    | nvarchar(128)  | 类型排序规则的名称       |
      +-------------------+----------------+--------------------------+
      | is_nullable       | bit            | 类型是否为NULL           |
      +-------------------+----------------+--------------------------+
      | is_user_defined   | bit            | 类型是否是用户定义的类型 |
      +-------------------+----------------+--------------------------+
      | is_assembly_type  | bit            | 是否是程序集类型         |
      +-------------------+----------------+--------------------------+
      | default_object_id | int            | 类型上默认值对象的OID    |
      +-------------------+----------------+--------------------------+
      | rule_object_id    | int            | 类型上RULE对象的OID      |
      +-------------------+----------------+--------------------------+
      | is_table_type     | bit            | 类型是否为表类型         |
      +-------------------+----------------+--------------------------+


