SYSCOLUMNS
SYSCOLUMNS视图为每个表和视图中的每列返回一行,并为数据库中的存储过程的每个参数返回一行。
表1 SYSCOLUMNS视图字段
| 列名称 | 数据类型 | 说明 |
|---|---|---|
| name | name | 列或过程参数的名称。 |
| id | oid | 此列所属表的对象 ID,或者与此参数关联的存储过程的 ID。 |
| xtype | oid | 类型 ID |
| typestat | tinyint | 直接返回0 |
| xusertype | smallint | 类型 ID |
| length | smallint | sys 的最大物理存储长度。类型。 |
| xprec | tinyint | 直接返回 0 |
| xscale | tinyint | 直接返回 0 |
| colid | smallint | 列 ID 或参数 ID。 |
| xoffset | smallint | 直接返回 0 |
| bitpos | tinyint | 直接返回 0 |
| reserved | tinyint | 直接返回 0 |
| colstat | smallint | 直接返回 0 |
| cdefault | oid | 此列的默认值的 ID。 |
| domain | oid | 此列的规则或 CHECK 约束的 ID。 |
| number | smallint | 过程分组时的子过程号。直接返回 0 |
| colorder | smallint | 直接返回 0 |
| autoval | bytea | 直接返回 null |
| offset | smallint | 此列所在行的偏移量。直接返回 0 |
| collationid | oid | 列的排序规则的 ID。 对于非字符列,此值为 NULL。 |
| status | tinyint | 用于说明列或参数的属性的位图: 0x08 = 列允许空值。 0x40 = 参数为 OUTPUT 参数。 |
| type | oid | 类型 ID |
| usertype | oid | 所属架构 ID |
| printfmt | varchar(255) | 直接返回 null |
| prec | smallint | 此列的精度级别。 -1 = xml 或大值类型。 |
| scale | int | 列的 scale NULL = 数据类型不是数值。 |
| iscomputed | int | 指示列是否为计算列的标志: 0 = 非计算列。 1 = 计算列。 |
| isoutparam | int | 指示过程参数是否为输出参数: 1 = True 0 = False |
| isnullable | int | 指示列是否允许空值: 1 = True 0 = False |
| collation | name | 列的排序规则的名称。 如果不是基于字符的列,则为 NULL。 |
