一、SQLServer命令
1、查詢SQLServer中的每個數據庫
SELECT * from sysdatabases
2、查詢SQLServer中指定數據庫的所有表名
select name from CFS.. sysobjects where xtype='u' #注意:CFS 是數據庫名稱
3、查詢表中的字段以及字段類型
select COLUMN_name as name,data_type as type from INFORMATION_SCHEMA.COLUMNS where table_name = '表名'
二、MySQL命令
1、查詢MySQL中的每個數據庫
show DATABASES
2、查詢MySQL中指定數據庫的所有表名
select table_name as name from information_schema.tables where table_schema = '數據庫名' and table_type = 'base table'
3、查詢表中的字段以及字段類型
select COLUMN_NAME as name,DATA_TYPE as type from information_schema.columns where table_schema='表名'
三、ORCAL命令
1、查詢ORCAL中的每個數據庫
select * from v$tablespace
2、查詢ORCAL中指定數據庫的所有表名
select * from user_tables;
3、查詢表中的字段以及字段類型
select column_name from user_tab_columns where table_name = 'table_name';--表名要全大寫