對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2016/1/26 12:57:10
查詢資料庫所有 tables 及 columns
因為需要直接取得 table 及 column name,
所以需要知道怎麼去取得這兩個訊息,
SQL 如下述:
DB2:
取得 table name,
取得 column name,
Oracle:
取得 table name,
取得 column name,
SQL Server:
取得 table name,
取得 column name,
原文出處:Lamb & Vampire: 查詢資料庫所有 tables 及 columns
因為需要直接取得 table 及 column name,
所以需要知道怎麼去取得這兩個訊息,
SQL 如下述:
DB2:
取得 table name,
select * from sysibm.systables;
取得 column name,
select * from sysibm.syscolumns;
Oracle:
取得 table name,
SELECT * FROM all_tables
取得 column name,
SELECT * FROM all_tab_columns
SQL Server:
取得 table name,
select * FROM [DB NAME].sys.tables
取得 column name,
SELECT * FROM [DB NAME].sys.columns
原文出處:Lamb & Vampire: 查詢資料庫所有 tables 及 columns