sqlserver 查看表名字段名,字段类型

SELECT
    LOWER (SO.name) tableName,
    LOWER (SC.name) colName,
    LOWER (ST.name) typeName,
    SC.colid colId,
    SC.isnullable nullable
FROM
    sysobjects SO,
    syscolumns SC,
    systypes ST
WHERE
    SO.id = SC.id
AND SO.xtype = 'U'
AND SO.status >= 0
AND SC.xtype = ST.xusertype
AND so.name = 'sys_position_dept'
ORDER BY
    SO.name,
    SC.colid

你可能感兴趣的:(数据库)