一、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';--表名要全大寫
參考網址1: https://www.cnblogs.com/lonelyxmas/p/10577287.html
參考網址2: https://www.jb51.net/article/136787.htm
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/114257.html
標籤:C#
上一篇:C#特性
