博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SqlServer中常常搞不清楚 sp_columns来看一看
阅读量:6836 次
发布时间:2019-06-26

本文共 2521 字,大约阅读时间需要 8 分钟。

The sp_columns catalog stored procedure is equivalent to SQLColumns in ODBC. The results returned are ordered by TABLE_QUALIFIER, TABLE_OWNER, and TABLE_NAME.

Column name Data type Description
TABLE_QUALIFIER sysname Object qualifier name. This field can be NULL.
TABLE_OWNER sysname Object owner name. This field always returns a value.
TABLE_NAME sysname Object name. This field always returns a value.
COLUMN_NAME sysname Column name, for each column of the TABLE_NAME returned. This field always returns a value.
DATA_TYPE smallint Integer code for ODBC data type. If this is a data type that cannot be mapped to an ODBC type, it is NULL. The native data type name is returned in the TYPE_NAMEcolumn.
TYPE_NAME sysname String representing a data type. The underlying DBMS presents this data type name.
PRECISION int Number of significant digits. The return value for the PRECISION column is in base 10.
LENGTH int Transfer size of the data.1
SCALE smallint Number of digits to the right of the decimal point.
RADIX smallint Base for numeric data types.
NULLABLE smallint Specifies nullability.
1 = NULL is possible.
0 = NOT NULL.
REMARKS varchar(254) This field always returns NULL.
COLUMN_DEF nvarchar(4000) Default value of the column.
SQL_DATA_TYPE smallint Value of the SQL data type as it appears in the TYPE field of the descriptor. This column is the same as the DATA_TYPE column, except for the datetime and SQL-92 intervaldata types. This column always returns a value.
SQL_DATETIME_SUB smallint Subtype code for datetime and SQL-92 interval data types. For other data types, this column returns NULL.
CHAR_OCTET_LENGTH int Maximum length in bytes of a character or integer data type column. For all other data types, this column returns NULL.
ORDINAL_POSITION int Ordinal position of the column in the object. The first column in the object is 1. This column always returns a value.
IS_NULLABLE varchar(254) Nullability of the column in the object. ISO rules are followed to determine nullability. An ISO SQL-compliant DBMS cannot return an empty string.
YES = Column can include NULLS.
NO = Column cannot include NULLS.
This column returns a zero-length string if nullability is unknown.
The value returned for this column is different from the value returned for the NULLABLE column.
SS_DATA_TYPE tinyint SQL Server data type used by extended stored procedures. For more information, see .

1 For more information, see the Microsoft ODBC documentation.

转载于:https://www.cnblogs.com/qianjinyan/p/6729760.html

你可能感兴趣的文章
unity使用UGUI创建摇杆
查看>>
实习小白::(转) 使用Tui-x制作cocos能使用的界面,动画等 ---------- Tui-x 简介...
查看>>
Red Hat 6.5 网络yum源的配置
查看>>
如何解决EditText使用时,点击外侧系统键盘不消失的bug
查看>>
SWAP_JOIN_INPUTS Oracle Hint(处理hash join强制大表(segment_size大)作为被驱动表)
查看>>
使用JSP渲染Web视图
查看>>
iOS_nil、Nil、NULL、NSNull的区别
查看>>
python操作excel小试牛刀
查看>>
vue通俗易懂的子组件向父组件传值
查看>>
加密传输SSL协议1_OpenSSL的安装
查看>>
Javascript Array Functions --Js 数组方法汇总
查看>>
安装arcgis server 10.2遇到的问题总结
查看>>
查看他人数据接口的安全校验机制
查看>>
react 通过 classnames 处理 多个class 的问题
查看>>
倒计时原理
查看>>
让ul中的li居中显示
查看>>
XJOI网上同步训练DAY2 T2
查看>>
Codeforces 509F Progress Monitoring
查看>>
spring cloud: eureka搭建
查看>>
导弹拦截
查看>>