sql server 数据库 查询数据库中所有的表和表对于的列名

SELECT
TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA = 'dbo'
ORDER BY
TABLE_NAME, ORDINAL_POSITION;

posted @ 2024-01-18 20:15  sifo  阅读(16)  评论(0编辑  收藏  举报