1、查询表结构

--查询表结构(字段名、字段类型、字段长度、能否为空)
SELECT syscolumns.name,systypes.name, syscolumns.length ,syscolumns.isnullable
FROM syscolumns, systypes
WHERE syscolumns.xusertype = systypes.xusertype AND syscolumns.id = object_id('表名')
05-08 15:07