1、查询数据库中所有的用户表:

select [name] from sysobjects where xtype='u'
select * from information_schema.tables

 

2、查询某表[tableName]中所有的字段名称:

select [name] from syscolumns where id = object_id('[tableName]')
select * from information_schema.columns where TABLE_NAME='[tableName]'

 

3、查询所有视图信息:

select [name] from sysobjects where xtype='v'
select * from information_schema.views 

 

相关文章:

  • 2022-12-23
  • 2022-02-18
  • 2022-01-31
  • 2021-11-29
  • 2021-09-19
  • 2021-12-01
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2021-11-28
  • 2021-07-30
  • 2022-12-23
  • 2021-11-22
  • 2021-09-10
相关资源
相似解决方案