• 00SQL表字段说明


    SELECT  d.name 表名 ,
            a.colorder 字段序号 ,
            a.name 字段名 ,
            ISNULL(g.[value], '') AS 字段说明 ,
            ( CASE WHEN COLUMNPROPERTY(a.id, a.name, 'IsIdentity') = 1 THEN '√'
                   ELSE ''
              END ) 标识 ,
            ( CASE WHEN ( SELECT    COUNT(*)
                          FROM      sysobjects
                          WHERE     ( name IN (
                                      SELECT    name
                                      FROM      sysindexes
                                      WHERE     ( id = a.id )
                                                AND ( indid IN (
                                                      SELECT    indid
                                                      FROM      sysindexkeys
                                                      WHERE     ( id = a.id )
                                                                AND ( colid IN (
                                                                  SELECT
                                                                  colid
                                                                  FROM
                                                                  syscolumns
                                                                  WHERE
                                                                  ( id = a.id )
                                                                  AND ( name = a.name ) ) ) ) ) ) )
                                    AND ( xtype = 'PK' )
                        ) > 0 THEN '√'
                   ELSE ''
              END ) 主键 ,
            b.name 类型 ,
            a.length 占用字节数 ,
            COLUMNPROPERTY(a.id, a.name, 'PRECISION') AS 长度 ,
            ISNULL(COLUMNPROPERTY(a.id, a.name, 'Scale'), 0) AS 小数位数 ,
            ( CASE WHEN a.isnullable = 1 THEN '√'
                   ELSE ''
              END ) 允许空 ,
            ISNULL(e.text, '') 默认值
    FROM    syscolumns a
            LEFT JOIN systypes b ON a.xtype = b.xusertype
            INNER JOIN sysobjects d ON a.id = d.id
                                       AND d.xtype = 'U'
                                       AND d.name <> 'dtproperties'
            LEFT JOIN syscomments e ON a.cdefault = e.id
            LEFT JOIN sys.extended_properties g ON a.id = g.major_id
                                                   AND a.colid = g.minor_id
    WHERE   d.name = 'IVOVisaProcessStatistics'
    ORDER BY a.id ,
            a.colorder
    

      

  • 相关阅读:
    hadoop之 hadoop日志存放路径
    grpc的数据包监控
    HTTP2 概述
    gRPC的简单Go例子
    win下环境变量的设置
    Go的pprof使用
    graphviz
    学习Golang的步骤建议
    golang 的 sync.WaitGroup
    【转】golang的channel的几种用法
  • 原文地址:https://www.cnblogs.com/hellowawei/p/7300344.html
Copyright © 2020-2023  润新知