获取数据库中用户表所有列和列的数据类型
时间:2021-07-01 10:21:17
帮助过:19人阅读
OBJECT_NAME(c.
OBJECT_ID)
AS [Table_Name], c.
[name] AS [Column_Name] ,t.
[name] AS [Data_Type_Name]
FROM sys.columns
AS c
LEFT JOIN SYSOBJECTS
AS s
ON (c.
[object_id] = s.
[id])
LEFT JOIN sys.types
AS t
ON (c.
[user_type_id]=t.
[user_type_id])
WHERE s.xtype
= ‘U‘
Source Code
获取数据库中用户表所有列和列的数据类型
标签:mic show sys pen closed 数据类型 取数 objects name