查詢資料庫裡所有表名和欄位名的語句
1.SQL 查詢所有表名:
SELECT NAME FROM SYSOBJECTS WHERE TYPE="U"
SELECT * FROM INFORMATION_SCHEMA.TABLES
2.查詢表的所有欄位名:
SELECT NAME FROM SYSCOLUMNS WHERE ID=OBJECT_ID(" 表名" )
SELECT * FROM INFORMATION_SCHEMA.VIEWS
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
3.ORACLE 檢視所有表名:
SELECT TABLE_NAME FROM USER_TABLES
4.ACCESS 檢視所有表名:
SELECT NAME FROM MSYSOBJECTS WHERE TYPE=1 AND FLAGS=0
5.MSYSOBJECTS 是系統物件,預設情況是隱藏的。透過工具、選項、檢視、顯示、系統物件可以使之顯示出來。
查詢資料庫裡所有表名和欄位名的語句
1.SQL 查詢所有表名:
SELECT NAME FROM SYSOBJECTS WHERE TYPE="U"
SELECT * FROM INFORMATION_SCHEMA.TABLES
2.查詢表的所有欄位名:
SELECT NAME FROM SYSCOLUMNS WHERE ID=OBJECT_ID(" 表名" )
SELECT * FROM INFORMATION_SCHEMA.TABLES
SELECT * FROM INFORMATION_SCHEMA.VIEWS
SELECT * FROM INFORMATION_SCHEMA.COLUMNS
3.ORACLE 檢視所有表名:
SELECT TABLE_NAME FROM USER_TABLES
4.ACCESS 檢視所有表名:
SELECT NAME FROM MSYSOBJECTS WHERE TYPE=1 AND FLAGS=0
5.MSYSOBJECTS 是系統物件,預設情況是隱藏的。透過工具、選項、檢視、顯示、系統物件可以使之顯示出來。