怎样得到一个表所有字段的大小、类型、精度、小数位、是否为空属性?
解决方案 »
- 一个关于RealAudio控件的问题!!
- 如何用SQL语句实现:查询某字段的下一行记录值减上一行记录值的差?
- ???????????????????*自定义过程问题*??????????????
- 程序运行到一半时,在任务管理器看到其显示为未响应,此时CPU占用为0.请问这都有可能是什么原因造成的.
- SendMessage的参数问题
- 请问:我用winexec 和 shellexecute 运行外部程序时,为啥程序报缺文件。
- 利用Idhttp不能填写账号密码登录的问题,急求~已经用了一个晚上了
- 怎么备份SQL server数据库中的几个表
- winzip文件坏了,有没有修复?哪位知道请尽快,要不今晚就要重复劳动了
- 如何使用Query求某一字段的和?对者有分!
- 急用?
- DBGrid中字体颜色的动态赋值?
syscolumns里怎么判断是哪个表的字段
'select cast(COLUMN_NAME as varchar(20)) 字段名称,' +
'cast(DATA_TYPE as varchar(10)) 字段类型,' +
'cast(CHARACTER_MAXIMUM_LENGTH as varchar(6)) 长度,' +
'cast(COLUMN_DEFAULT as varchar(10)) 默认值,IS_NULLABLE 允许空值 ' +
'from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = ''YourTableName'''; 更多,依照下面的说明加进去TABLE_CATALOG nvarchar(128) Table qualifier.
TABLE_SCHEMA nvarchar(128) Table owner.
TABLE_NAME nvarchar(128) Table name.
COLUMN_NAME nvarchar(128) Column name.
ORDINAL_POSITION smallint Column identification number.
COLUMN_DEFAULT nvarchar(4000) Default value of the column.
IS_NULLABLE varchar(3) Nullability of the column. If this column allows NULL, this column returns YES. Otherwise, NO is returned.
DATA_TYPE nvarchar(128) System-supplied data type.
CHARACTER_MAXIMUM_LENGTH smallint Maximum length, in characters, for binary data, character data, or text and image data. Otherwise, NULL is returned. For more information, see Data Types.
CHARACTER_OCTET_LENGTH smallint Maximum length, in bytes, for binary data, character data, or text and image data. Otherwise, NULL is returned.
NUMERIC_PRECISION tinyint Precision of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.
NUMERIC_PRECISION_RADIX smallint Precision radix of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.
NUMERIC_SCALE tinyint Scale of approximate numeric data, exact numeric data, integer data, or monetary data. Otherwise, NULL is returned.
DATETIME_PRECISION smallint Subtype code for datetime and SQL-92 interval data types. For other data types, NULL is returned.
CHARACTER_SET_CATALOG varchar(6) Returns master, indicating the database in which the character set is located, if the column is character data or text data type. Otherwise, NULL is returned.
CHARACTER_SET_SCHEMA varchar(3) Returns DBO, indicating the owner name of the character set, if the column is character data or text data type. Otherwise, NULL is returned.
CHARACTER_SET_NAME nvarchar(128) Returns the unique name for the character set if this column is character data or text data type. Otherwise, NULL is returned.
COLLATION_CATALOG varchar(6) Returns master, indicating the database in which the sort order is defined, if the column is character data or text data type. Otherwise, this column is NULL.
COLLATION_SCHEMA varchar(3) Returns DBO, indicating the owner of the sort order for character data or text data type. Otherwise, NULL is returned.
COLLATION_NAME nvarchar(128) Returns the unique name for the sort order if the column is character data or text data type. Otherwise, NULL is returned.
DOMAIN_CATALOG nvarchar(128) If the column is a user-defined data type, this column is the database name in which the user-defined data type was created. Otherwise, NULL is returned.
DOMAIN_SCHEMA nvarchar(128) If the column is a user-defined data type, this column is the creator of the user-defined data type. Otherwise, NULL is returned.
DOMAIN_NAME nvarchar(128) If the column is a user-defined data type, this column is the name of the user-defined data type. Otherwise, NULL is returned.