首页 > 数据库 >数据库表导出字详细描述文档

数据库表导出字详细描述文档

时间:2023-04-03 16:24:52浏览次数:34  
标签:join name 数据库 导出 详细描述 查询 文档 id

需求:

数据库表导出类似这种

 

 

实现方法

SQL查询,然后赋值到excel或者word

 

案例Sql

SELECT
字段名 = a.name,
字段说明 = isnull(g.[value],''),
类型 = CASE WHEN b.name = 'varchar' OR b.name = 'nvarchar' THEN b.name+'('+CONVERT(VARCHAR(20),COLUMNPROPERTY(a.id,a.name,'PRECISION'))+')' ELSE b.name END,
允许null值 = CASE WHEN a.isnullable ='0' THEN 'N' ELSE 'Y' end
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='HIS_request' --如果只查询指定表,加上此红色where条件,tablename是要查询的表名;去除红色where条件查询所有的表信息
order by a.id,a.colorder

 

标签:join,name,数据库,导出,详细描述,查询,文档,id
From: https://www.cnblogs.com/yuanshuo/p/17283398.html

相关文章

  • smark doc api文档生成器插件
    1、pom.xml文件导入插入包 <?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http:/......
  • @Transactional(propagation=Propagation.REQUIRED)数据库事务的7种传播行为特性
      ClassA{@Transactional(propagation=propagation.REQUIRED)publicvoidaMethod{Bb=newB();b.bMethod();}}//inB.javaClassB{@Transactional(propagation=propagation.REQUIRED)publicvoidbMethod......
  • 项目文档清单
    一、 需求阶段:《需求评审结果、意见》—需求评审会议纪要《需求说明书V2.0》—评审会修改意见修订履历二、 采购阶段:《合同》三、 详设部分:《项目计划》《详设说明书》四、 测试部门:《测试用例》《测试报告》五、 上线阶段:部署需求表资源需求表上线申请六、 验收......
  • C# 后台服务监控SQL Server数据库表改动并同步到MySQL数据库表
    需求将A服务器的sqlserver数据库item_mst表的数据同步到MySQL数据库Part表监控Item_mst表中item,description,overview的更改并同步到MySQL数据库 针对需求一,基本就是执行一次,单独写了个winform用来做这事针对需求二,写了个Windowsserviceapp Nuget安装 Dapper就是个ormSeril......
  • 零基础Go语言从入门到精通(数据库编程:02-Gorm 操作 MySQL 数据库)
    gin-gorm-api-example/main.goatmaster·cgrant/gin-gorm-api-example·GitHubhttps://github.com/cgrant/gin-gorm-api-example/blob/master/main.goGorm介绍ThefantasticORMlibraryforGolangGo语言的超棒的ORM类库功能强大:全功能ORM(几乎)关联(包含一个,包含多个,属......
  • 全网最详细中英文ChatGPT-GPT-4示例文档-复杂函数快速转单行函数从0到1快速入门——官
    目录Introduce简介setting设置Prompt提示Sampleresponse回复样本APIrequest接口请求python接口请求示例node.js接口请求示例curl命令示例json格式示例其它资料下载ChatGPT是目前最先进的AI聊天机器人,它能够理解图片和文字,生成流畅和有趣的回答。如果你想跟上AI时代的潮流......
  • Visual Studio Code 使用插件 Markdown Preview Enhanced 导出文档时和自定义设置的预
    首先,我这里的预览主题设置为了vue.css  但是导出时并不正常,根本不是vue.css这个主题的外观。所以需要在插件中配置如下内容:以下配置项都在VSCode的Extension->MarkdownPreviewEnhanced中找到 1.CodeBlockTheme配置成预览一样  2.PrintBackground......
  • 时序数据库
    时序数据库1.常用数据库排名db-engines网站https://db-engines.com/en/ranking/time+series+dbms2.系统属性比较NameClickHouseXTDengineXPrometheusXInfluxDBXTimescaleDBX描述Column-orientedRelationalDBMSpoweringYandexTimeSerie......
  • Greenplum数据库连接
    Greenplum数据库连接maven配置<!--https://mvnrepository.com/artifact/org.postgresql/postgresql--><dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId><version>42.1.4</vers......
  • StreamSets单机版安装文档
    StreamSets单机版安装文档解压安装包到opt目录tar-zxvfstreamsets-datacollector-common-3.22.3.tgz-C/opt修改为sdc配置为表单认证cd/opt/streamsets-datacollector-3.22.3/vietc/sdc.propertieshttp.authentication=form后台启动nohup./bin/streamsets......