根据数据库系统表查询表/列/长度语句

来源:互联网 发布:mac导入iphone照片 编辑:程序博客网 时间:2024/05/21 07:57
SELECT c.id 对象ID, c.name 列名, o.name AS 对象名, t.name 列类型名, c.prec 此列的精度级别FROM sys.syscolumns AS cJOIN sys.sysobjects AS o ON c.id = o.id JOIN sys.types AS t ON c.xusertype = t.user_type_idWHERE o.xtype NOT IN ('S', 'IT', 'SQ', 'P', 'PC', 'RF', 'X', 'AF', 'FN', 'FS');SELECT o.name table_name, c.name column_name, t.name coltype_nameFROM sys.syscolumns AS cJOIN sys.sysobjects AS o ON c.id = o.id JOIN sys.types AS t ON c.xusertype = t.user_type_idWHERE o.xtype NOT IN ('S', 'IT', 'SQ', 'P', 'PC', 'RF', 'X', 'AF', 'FN', 'FS');

0 0
原创粉丝点击