1、MSSQL Server 1 2 select count(*) from dbo.sysobjects where name= '表名'; -- 表 select count(*) from syscolumns where id=object_id(‘表名’) and name= '字段名'; -- 字段 2、Oracle 1 2 select count(*) from user_objects where object_name = '表名'; -- 表 select count(*) from user_tab_columns where table_name = '表名' and column_name = '字段名'; -- 字段 3、MySQL 1 2 select table_name from information_schema.tables where table_name ='表名'; -- 表 select count(*) from information_schema.columns where table_name = '表名' and column_name = '字段名' -- 字段 4、PostgreSql 1 2 select count(*) from information_schema.tables where table_schema='table_schema' and table_name ='表名'; -- 表 select count(*) from information_schema.columns where table_schema='table_schema' and table_name ='表名' and column_name='字段名'; -- 字段