SELECT
C.name as [字段名],T.name as [字段类型]
,convert(bit,C.IsNullable) as [可否为空]
,convert(bit,case when exists(SELECT 1 FROM sysobjects where xtype='PK' and parent_obj=c.id and name in (
SELECT name FROM sysindexes WHERE indid in(
SELECT indid FROM sysindexkeys WHERE id = c.id AND colid=c.colid))) then 1 else 0 end)
as [是否主键]
,convert(bit,COLUMNPROPERTY(c.id,c.name,'IsIdentity')) as [自动增长]
,C.Length as [占用字节]
,COLUMNPROPERTY(C.id,C.name,'PRECISION') as [长度]
,isnull(COLUMNPROPERTY(c.id,c.name,'Scale'),0) as [小数位数]
,ISNULL(CM.text,'') as [默认值]
,isnull(ETP.value,'') AS [字段描述]
--,ROW_NUMBER() OVER (ORDER BY C.name) AS [Row]
FROM syscolumns C
INNER JOIN systypes T ON C.xusertype = T.xusertype
left JOIN sys.extended_properties ETP ON ETP.major_id = c.id AND ETP.minor_id = C.colid AND ETP.name ='MS_Description'
left join syscomments CM on C.cdefault=CM.id
WHERE C.id = object_id('Sys_Member')

最新文章

  1. swift-懒加载
  2. clip 属性剪裁绝对定位元素
  3. wpf 后台绘制圆弧
  4. NSString 字符串替换
  5. glusterFS的常用命令 (转)
  6. http请求利器: 今天配置出了RESTClient,用MAVEN构建了UI运行包
  7. 松下蓄电池与UPS使用和维护
  8. margin系列之百分比
  9. Palindrome - URAL - 1297(求回文串)
  10. js的兼容性问题
  11. 第19讲- UI组件之_Button、checkbox、radio
  12. ThreadPoolExecutor详解
  13. java和.net的类比
  14. Intellj Idea使用tomcat部署不成功,死活也找不到解决办法的看这里
  15. java 表现层:jsp、freemarker、velocity
  16. POJ1741Tree [点分治]【学习笔记】
  17. LeetCode算法题-Longest Continuous Increasing Subsequence(Java实现)
  18. 3.Qt GUI中一些操作记录
  19. foreach Transform 同时chils.setParent引起的bug
  20. MemSQL与MySQL不兼容问题总结

热门文章

  1. layui 数据表格自带的导出Excel,身份证等E+/000问题解决
  2. Java中的大数值使用
  3. web自动化 -- 浏览器窗口切换
  4. 贪心法-------Saruman's army
  5. Python while 中简单的语句组
  6. PHP restore_error_handler() 函数
  7. PHP rmdir() 函数
  8. RectTransform的localPosition与anchoredPosition(3D)的区别
  9. Use SQL to Query Data from CDS and Dynamics 365 CE
  10. SSRS - 请求因 HTTP 状态 401 失败: Unauthorized。