sql server 查询表基本信息sql
SELECT c.name,t.name TYPE,c.max_length,c.precision,c.scale,p.value FROM sys.systypes t INNER JOIN sys.columns c ON t.xtype=c.system_type_id INNER JOIN sys.sysobjects o ON c.object_id=o.id LEFT JOIN sys.extended_properties p ON p.major_id=c.object_id AND p.minor_id=c.column_id WHERE o.name='表名' AND t.name<>'sysname' ORDER BY value DESC
说明:我用的是sql server 2008