獲得資料庫中所有的表

2021-08-30 10:01:33 字數 435 閱讀 5878

在資料庫中一般都會有乙個系統表來記錄下所有的使用者表或檢視,儲存過程等等的.名字就叫sysobjects.所有要查詢出所有的表可以用以下語句:

sql2000:

select * from sysobjects where xtype =   ' u或 v 或 p '

access:

select * from msysobjects where flags = 0 and type=1

oracle:

select * from tab;

mysql:

select * from information_schema.`tables` t where t.table_schema='udb_liss'

查詢資料庫中所有的表

select from sysobjects where xtype u 查詢當前資料庫下所有使用者建立的表 xtype char 2 物件型別。可以是下列物件型別中的一種 c check 約束 d 預設值或 default 約束 f foreign key 約束 l 日誌 fn 標量函式 if 內...

C 獲取資料庫中所有的表名

select name from sysobjects where xtype u 使用者表,系統表是 s 近日使用oledb來操作excel檔案,xls檔案裡面當然不可能會存在sysobjects這個系統表,這時候我們需要用oledbconnection裡面的乙個函式來返回資料庫的結構表,從而獲得...

Oracle查詢資料庫中所有的表名稱

1.查詢資料庫中所有的表名稱和每張表所對應的資料條數 select t.table name,t.num rows from user tables t 此處需要注意的是 在查詢每張表所對應的資料條數時會與利用sql select count from tablename 所查詢出來的結果有所不同,...