SQL语句查询某表的所有字段及数据类型
SELECT name AS column_name ,
TYPE_NAME(system_type_id) AS column_type ,
max_length ,
is_nullable
FROM sys.columns
WHERE object_id = OBJECT_ID(N'customerbase') --customerbase 为表名
2024-01-05 21:20:40
SQL语句查询某表的所有字段及数据类型
SELECT name AS column_name ,
TYPE_NAME(system_type_id) AS column_type ,
max_length ,
is_nullable
FROM sys.columns
WHERE object_id = OBJECT_ID(N'customerbase') --customerbase 为表名