当前位置:Gxlcms > 数据库问题 > SQL查询表的所有字段名

SQL查询表的所有字段名

时间:2021-07-01 10:21:17 帮助过:9人阅读

SQL SERVER

查看所有表名:

select name from sysobjects where type='U'

查询表的所有字段名:

Select name from syscolumns Where ID=OBJECT_ID('表名')

select * from information_schema.tables
select * from information_schema.views
select * from information_schema.columns

MySql
查询表的所有字段名:

select *
from information_schema.columns 
where table_name='table_name' 
and table_schema='table_schema'
ORDER BY ORDINAL_POSITION

ACCESS

查看所有表名:

select name from MSysObjects where type=1 and flags=0

MSysObjects是系统对象,默认情况是隐藏的。通过工具、选项、视图、显示、系统对象可以使之显示出来。

Oracle

select cname from col where tname='ZW_YINGYEZ'
select column_name from user_tab_columns where table_name='ZW_YINGYEZ'

查询表字段数

select count(column_name) from user_tab_columns where table_name='表名';

SQL查询表的所有字段名

标签:pos   查询   obj   inf   cname   column   ESS   format   order   

人气教程排行