当前位置:网站首页>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
边栏推荐
- 【 tutoriel】 Chrome ferme les cors et les messages de la politique inter - domaines et apporte des cookies à travers les domaines
- Unrecognized SSL message, plaintext connection?
- 面试项目技术栈总结
- [translation] flux is safe. Gain more confidence through fuzzy processing
- Tongda OA homepage portal workbench
- COM and cn
- Thread safe singleton mode
- Gbase 8C system table PG_ authid
- 怎么将yolov5中的PANet层改为BiFPN
- Gbase 8C system table PG_ aggregate
猜你喜欢

How to change the panet layer in yolov5 to bifpn

awk从入门到入土(0)awk概述

The Linux server needs to install the agent software EPS (agent) database

SQL statement

Return a tree structure data

The use of Flink CDC mongodb and the implementation of Flink SQL parsing complex nested JSON data in monggo

Random Shuffle attention

Tongda OA V12 process center

SPI机制

Principle and application of database
随机推荐
Unrecognized SSL message, plaintext connection?
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
【翻译】具有集中控制平面的现代应用负载平衡
Gbase 8C create user / role example 2
【教程】chrome关闭跨域策略cors、samesite,跨域带上cookie
The data in servlet is transferred to JSP page, and the problem cannot be displayed using El expression ${}
5.文件操作
GBase 8c系统表-pg_collation
awk从入门到入土(1)awk初次会面
Codeforces Round #418 (Div. 2) D. An overnight dance in discotheque
require. context
The Linux server needs to install the agent software EPS (agent) database
Awk from getting started to being buried (2) understand the built-in variables and the use of variables in awk
二维格式数组格式索引下标连续问题导致 返回json 格式问题
[tutorial] chrome turns off cross domain policies CORS and samesite, and brings cookies across domains
SQL statement
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
[advanced ROS] Lesson 6 recording and playback in ROS (rosbag)
random shuffle注意
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution