Skip to content

SqlServer 如何获取表和表结构?

获取所有非系统表

sql
SELECT name FROM sys.databases WHERE database_id > 4

获取表名及表备注

sql
SELECT
        a.name AS Name,
        ISNULL(g.[value],'-') AS Description
FROM
        sys.tables a 
        LEFT JOIN sys.extended_properties g
        ON      (a.object_id           = g.major_id 
                        AND g.minor_id = 0 
                )

获取表的所有列名 | 备注 | 类型

sql
SELECT
        a.name AS Name,
        ISNULL(g.[value],'-') AS Description,
        c.name AS Type
FROM
        sys.columns a
        LEFT JOIN sys.extended_properties g
        ON      (a.object_id           = g.major_id 
                        AND g.minor_id = a.column_id 
                )
        LEFT JOIN systypes c
        ON      a.system_type_id = c.xusertype
WHERE   a.object_id              =
        (SELECT object_id FROM sys.tables WHERE name = @TableName 
        )

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.