zoukankan      html  css  js  c++  java
  • 查询表字段信息

    string sql = string.Format(@"
                                SELECT
                                    syscolumns.colid,
                                    Sysobjects.name AS [TableName],
                                    syscolumns.name AS [ColumnName],
                                    systypes.name AS [DataType],
                                    syscolumns.length AS [DataLength],
                                    sys.extended_properties.[value] AS [Description],  
                                    syscomments.text AS [DefaultValue],
                                    syscolumns.isnullable AS [NullAble]    
                                FROM
                                    syscolumns INNER JOIN systypes
                                    ON syscolumns.xtype = systypes.xtype
                                    LEFT JOIN sysobjects ON syscolumns.id = sysobjects.id
                                    LEFT OUTER JOIN sys.extended_properties ON
                                    ( sys.extended_properties.minor_id = syscolumns.colid
                                    AND sys.extended_properties.major_id = syscolumns.id)
                                    LEFT OUTER JOIN syscomments ON syscolumns.cdefault = syscomments.id
                                WHERE syscolumns.id IN
                                (SELECT id FROM SYSOBJECTS WHERE xtype = 'U' AND NAME = '{0}') AND (systypes.name <> 'sysname')
                                ORDER BY syscolumns.colid
    ", tbName);
  • 相关阅读:
    python基础总结二
    HTTP和HTTPS的区别
    通过HTTP请求响应过程了解HTTP协议
    稳定性测试+易用性测试
    容错测试点
    功能测试思考点
    功能测试-UI测试思考点
    字符编码-11
    字典+再识函数-8
    web API的概念
  • 原文地址:https://www.cnblogs.com/zhangchenliang/p/1635598.html
Copyright © 2011-2022 走看看