标签:rac sel info format sql select cte ble sele
方法一:(无法查询字符的最大长度)
--use后面添加表格所在的数据库名,为了定位到表格的位置
Use 数据库名;
--此处查询到的空值使用的是bit类型存储,即所显示的是0或者1
SELECT Column_Name as 字符名称,TYPE_NAME(SYSTEM_TYPE_ID) AS 字符类型,Is_NullAble as 是否为空值 from sys.columns where Object_id = OBJECT_ID(N‘所要查询的表‘)
方法二:(该方法可以查询字符的最大长度)
SELECT Column_Name as 字符名称,DATA_TYPE as 字符类型,CHARACTER_MAXIMUM_LENGTH as 字符最大长度,IS_NULLABLE as 是否为空 FROM information_schema.columns WHERE table_name = ‘STMS_Student‘
SQL Server查询指定表格字段、类型、长度、是否可为空等等信息
标签:rac sel info format sql select cte ble sele
原文地址:https://www.cnblogs.com/Kai-YoungMaster/p/13143338.html