自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

sql server查詢字段詳細(xì)信息

數(shù)據(jù)庫(kù) SQL Server
sql server數(shù)據(jù)庫(kù)中,應(yīng)該如何查詢字段的詳細(xì)信息呢?這是很多人都問(wèn)過(guò)的問(wèn)題,下文對(duì)該功能的實(shí)現(xiàn)方法作詳細(xì)的介紹,供您參考。

sql server查詢字段詳細(xì)信息是我們經(jīng)常需要的操作,下面就為您詳細(xì)介紹sql server查詢字段詳細(xì)信息的方法,希望對(duì)您能夠有所幫助。

 

  1. SELECT   
  2. (case when a.colorder=1 then d.name else '' end) N'表名',   
  3. a.colorder N'字段序號(hào)',   
  4. a.name N'字段名',   
  5. (case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end) N'標(biāo)識(shí)',   
  6. (case when (SELECT count(*)   
  7. FROM sysobjects   
  8. WHERE (name in   
  9. (SELECT name   
  10. FROM sysindexes   
  11. WHERE (id = a.id) AND (indid in   
  12. (SELECT indid   
  13. FROM sysindexkeys   
  14. WHERE (id = a.id) AND (colid in   
  15. (SELECT colid   
  16. FROM syscolumns   
  17. WHERE (id = a.id) AND (name = a.name))))))) AND   
  18. (xtype = 'PK'))>0 then '√' else '' end) N'主鍵',   
  19. b.name N'類(lèi)型',   
  20. a.length N'占用字節(jié)數(shù)',   
  21. COLUMNPROPERTY(a.id,a.name,'PRECISION') as N'長(zhǎng)度',   
  22. isnull(COLUMNPROPERTY(a.id,a.name,'Scale'),0) as N'小數(shù)位數(shù)',   
  23. (case when a.isnullable=1 then '√'else '' end) N'允許空',   
  24. isnull(e.text,'') N'默認(rèn)值',   
  25. isnull(g.[value],'') AS N'字段說(shuō)明'   
  26. --into ##tx   
  27.  
  28. FROM syscolumns a left join systypes b   
  29. on a.xtype=b.xusertype   
  30. inner join sysobjects d   
  31. on a.id=d.id and d.xtype='U' and d.name<>'dtproperties'   
  32. left join syscomments e   
  33. on a.cdefault=e.id   
  34. left join sysproperties g   
  35. on a.id=g.id AND a.colid = g.smallid   
  36. order by object_name(a.id),a.colorder   

 

 

 

【編輯推薦】

sql server查詢平均值的實(shí)現(xiàn)

SQL Server FROM子句的語(yǔ)法

SQL Server跨服務(wù)器建立視圖

SQL Server綁定連接的類(lèi)型

深入了解SQL Server連接字符串

責(zé)任編輯:段燃 來(lái)源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-09-06 11:57:33

sql server語(yǔ)句

2012-05-14 10:49:25

Cloud Found

2025-01-22 09:57:15

2009-07-27 10:48:53

ASP.NET Det

2010-10-21 14:54:32

查詢SQL Serve

2010-11-11 16:59:59

SQL Server視

2020-11-17 12:59:34

數(shù)據(jù)泄露Capcom惡意軟件

2016-01-07 13:52:17

Windows 10登錄顯示

2020-05-15 07:00:00

Linux硬盤(pán)信息

2010-07-22 10:30:36

SQL Server數(shù)

2024-04-11 08:26:34

Android系統(tǒng)命令

2019-08-26 11:53:38

Linux系統(tǒng)GUI

2020-09-17 14:57:39

CISA黑客漏洞

2015-08-27 15:03:08

Live Query sql2016Livesql2016 調(diào)優(yōu)s

2010-11-09 12:09:23

SQL Server查

2010-09-25 15:26:45

SQL查詢語(yǔ)句

2009-07-27 16:31:19

ASP.NET Det

2010-03-23 16:16:21

Python文件

2009-07-16 08:48:40

微軟Windows 7EWindows 7歐洲

2022-12-13 15:15:02

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)