当前位置:网站首页>sql server 查詢指定錶的錶結構
sql server 查詢指定錶的錶結構
2022-07-03 02:33:00 【Lee魅兒】
SELECT
錶名 = 'dbo.Treestructure',
錶說明 = CASE WHEN A.COLORDER=1 THEN ISNULL(F.VALUE,'') ELSE '' END,
字段序號 = A.COLORDER,
字段名 = A.NAME,
自增標識 = CASE WHEN COLUMNPROPERTY( A.ID,A.NAME,'ISIDENTITY')=1 THEN '√'ELSE '' END,
主鍵 = CASE WHEN EXISTS(SELECT 1 FROM SYSOBJECTS WHERE XTYPE='PK' AND PARENT_OBJ=A.ID AND NAME IN (
SELECT NAME FROM SYSINDEXES WHERE INDID IN(
SELECT INDID FROM SYSINDEXKEYS WHERE ID = A.ID AND COLID=A.COLID))) THEN '√' ELSE '' END,
數據類型 = B.NAME,
占用字節數 = A.LENGTH,
長度 = COLUMNPROPERTY(A.ID,A.NAME,'PRECISION'),
小數比特數 = ISNULL(COLUMNPROPERTY(A.ID,A.NAME,'SCALE'),0),
是否可空 = CASE WHEN A.ISNULLABLE=1 THEN '√'ELSE '' END,
默認值 = ISNULL(E.TEXT,''),
字段說明 = ISNULL(G.[VALUE],'')
FROM
SYSCOLUMNS A
LEFT JOIN SYSTYPES B ON A.XUSERTYPE=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
LEFT JOIN sys.extended_properties F ON D.ID=F.major_id AND F.minor_id=0
where
D.name = 'Treestructure'
ORDER BY D.NAME,A.ID,A.COLORDER
边栏推荐
- GBase 8c系统表-pg_amop
- Gbase 8C create user / role example 2
- Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
- Detailed analysis of micro service component sentinel (hystrix)
- GBase 8c系统表-pg_authid
- Build a private cloud disk cloudrev
- Why choose a frame? What frame to choose
- Awk from getting started to getting into the ground (3) the built-in functions printf and print of awk realize formatted printing
- What does "where 1=1" mean
- javeScript 0.1 + 0.2 == 0.3的问题
猜你喜欢

UDP receive queue and multiple initialization test

Random shuffle note

"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b

基于can总线的A2L文件解析(2)
![[Hcia]No.15 Vlan间通信](/img/59/a467c5920cbccb72040f39f719d701.jpg)
[Hcia]No.15 Vlan间通信

Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
![[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数](/img/06/ab333a4752de27eae2dd937cf579e2.png)
[Flutter] dart: class;abstract class;factory;类、抽象类、工厂构造函数

Oauth2.0 authentication, login and access "/oauth/token", how to get the value of request header authorization (basictoken)???

Memory pool (understand the process of new developing space from the perspective of kernel)

Matlab tips (24) RBF, GRNN, PNN neural network
随机推荐
GBase 8c 函数/存储过程定义
GBase 8c系统表-pg_collation
Servlet中数据传到JSP页面使用el表达式${}无法显示问题
Gbase 8C system table PG_ class
Monitoring and management of JVM
Baidu map - surrounding search
Create + register sub apps_ Define routes, global routes and sub routes
8 free, HD, copyright free video material download websites are recommended
Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
GBase 8c 函数/存储过程参数(一)
Memory pool (understand the process of new developing space from the perspective of kernel)
面试八股文整理版
二维格式数组格式索引下标连续问题导致 返回json 格式问题
GBase 8c系统表-pg_auth_members
javeScript 0.1 + 0.2 == 0.3的问题
Wechat - developed by wechat official account Net core access
Javescript 0.1 + 0.2 = = 0.3 problem
Exception handling in kotlin process
Build a private cloud disk cloudrev
簡單理解svg