一、查询某个数据库中所有数据表的名称

  1. Select TABLE_NAME FROM DBTest02.INFORMATION_SCHEMA.TABLES Where TABLE_TYPE='BASE TABLE'

SQL查询某个数据库所有表名、表中字段名

 

二、查询某个数据表中所有字段的信息

2.1 查询某个表字段的所有信息

  1. use DBTest02
  2. select * from syscolumns where id=object_id('StuCourceInfo');

SQL查询某个数据库所有表名、表中字段名

 

2.2 查询某个表的字段名

  1. use DBTest02
  2. select name from syscolumns where id=object_id('StuCourceInfo');

SQL查询某个数据库所有表名、表中字段名

2.3 查询某个表字段的个数

  1. use DBTest02
  2. select count(*) from syscolumns where id=object_id('StuCourceInfo');

SQL查询某个数据库所有表名、表中字段名

 

参考文献:

http://www.2cto.com/database/201403/283781.html

http://www.dedecms.com/knowledge/data-base/sql-server/2012/0821/11037.html

相关文章:

  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2022-03-09
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
相关资源
相似解决方案