当前位置:网站首页>SQL server queries the table structure of the specified table
SQL server queries the table structure of the specified table
2022-07-03 02:34:00 【Lee Meier】
SELECT
Table name = 'dbo.Treestructure',
Table description = CASE WHEN A.COLORDER=1 THEN ISNULL(F.VALUE,'') ELSE '' END,
Field ordinal number = A.COLORDER,
Field name = A.NAME,
Self increasing label = CASE WHEN COLUMNPROPERTY( A.ID,A.NAME,'ISIDENTITY')=1 THEN '√'ELSE '' END,
Primary key = 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,
data type = B.NAME,
Bytes occupied = A.LENGTH,
length = COLUMNPROPERTY(A.ID,A.NAME,'PRECISION'),
Decimal digit = ISNULL(COLUMNPROPERTY(A.ID,A.NAME,'SCALE'),0),
Could you empty = CASE WHEN A.ISNULLABLE=1 THEN '√'ELSE '' END,
The default value is = ISNULL(E.TEXT,''),
Field description = 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
边栏推荐
- Classes and objects - initialization and cleanup of objects - constructor call rules
- The sandbox explains its vision for the meta universe platform
- Interview stereotyped version
- Gbase 8C system table PG_ amproc
- 二维格式数组格式索引下标连续问题导致 返回json 格式问题
- Face recognition 6-face_ recognition_ Py based on OpenCV, face detection and real-time tracking using Haar cascade and Dlib Library
- Detailed introduction to the usage of Nacos configuration center
- SPI机制
- Gbase 8C system table PG_ cast
- Wechat - developed by wechat official account Net core access
猜你喜欢
"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
SPI机制
xiaodi-笔记
Detailed introduction to the deployment and usage of the Nacos registry
random shuffle注意
awk从入门到入土(0)awk概述
定了,就选它
random shuffle注意
搭建私有云盘 cloudreve
Job object of collaboration in kotlin
随机推荐
Tongda OA homepage portal workbench
MUX VLAN Foundation
[translation] flux is safe. Gain more confidence through fuzzy processing
xiaodi-笔记
Monitoring and management of JVM
簡單理解svg
Gbase 8C system table PG_ collation
random shuffle注意
Detailed introduction to the usage of Nacos configuration center
二维格式数组格式索引下标连续问题导致 返回json 格式问题
Gbase 8C create user / role example 2
Compréhension simple de SVG
Exception handling in kotlin process
random shuffle注意
Apple releases MacOS 11.6.4 update: mainly security fixes
GBase 8c 创建用户/角色 示例二
Cvpr2022 remove rain and fog
HW-初始准备
【CodeForces】CF1338A - Powered Addition【二进制】
面试项目技术栈总结