SQL SERVER 批量查询指定表的表结构
来源:互联网 发布:文学 知乎 编辑:程序博客网 时间:2024/05/16 11:45
查询sql server数据库中表的结构
--字段数据类型:C:定长字符型(CHAR);VC:可变字符型(VARCHAR);N:数字或者浮点型;D:日期型;
--可以为空字段:Y表示可以为空,N表示不可以为空
最终按如下规则展现:
select obj.name c_tbname,UPPER(col.name) c_colname,sep.value c_coldesc, ( select case when d.name in('varchar','nvarchar','text') then 'VC' when d.name in('char','nchar') then 'C' when d.name in('numeric','real','int','smallint','bigint','float','money','decimal') then 'N' when d.name in('datetime','smalldatetime') then 'D' else '#' end c_stype from systypes c,systypes d where c.xtype = d.xtype and d.xtype = d.xusertype and col.xtype = c.xusertype ) c_systype, case when col.xscale > 0 then col.xprec when col.xscale = 0 then col.length else null end l_length, case when col.xscale>0 then col.xscale else null end l_xscale, case when col.isnullable=0 then 'N' when col.isnullable=1 then 'Y' else '#' end c_isnullfrom sysobjects obj, syscolumns col left join sys.extended_properties sep on col.id = sep.major_id and col.colid = sep.minor_idwhere obj.id = col.id and obj.xtype='U' and obj.name in('表名','.....' )order by obj.name,col.colorder;
0 0
- SQL SERVER 批量查询指定表的表结构
- SQL Server 树型结构查询指定节点 SQL Server 树型结构查询的排序
- sql server查询表结构
- Sql Server 获取指定表、视图结构
- SQL SERVER 查询表结构的SQL语句
- 查询表结构SQL Server And Oracle
- SQL Server 使用 Select 查询表结构
- 表结构信息查询 sql server 2005
- 通用SQL Server查询表结构脚本
- 查询SQL SERVER表结构信息
- SQL Server里查询表结构命令
- SQL Server里查询表结构命令
- SQL Server查询表结构信息
- SQL Server里查询表结构命令
- sql server 查询数据库表结构
- SQL Server—查询表结构
- sql工具:一条sql语句,查询sql server某个指定表的所有列及其属性
- sql工具:一条sql语句,查询sql server某个指定表的所有列及其属性
- gcc
- leetcode--Excel Sheet Column Number
- hdoj 1411 校庆神秘建筑 【四面体体积】
- java并发(3)-join,Interrupted
- ViewPager的使用方法
- SQL SERVER 批量查询指定表的表结构
- 消息中间件
- 提高第10课时,自测
- BZOJ4012【动态点分治】
- iOS中项目设置设备不可横竖屏切换
- IOS学习笔记32—使用Storyboard实现复杂界面
- 汉字拼音转换大师 1.08(去过期,去退出时访问网站,去生成桌面.lnk
- 与MongoDB的第一次亲密接触
- 我的iOS工程结构