Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12470496
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: SQLServer

2015-04-16 16:40:41

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

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

image

 

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

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

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

image

 

2.2 查询某个表的字段名

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

image

2.3 查询某个表字段的个数

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

image

 

参考文献:

阅读(4514) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~