獲取資料庫所有表名與欄位名

2021-04-28 22:08:12 字數 359 閱讀 9551

1.獲取所有資料庫名:

select name from master..sysdatabases

2.獲取所有表名:

select name from sysobjects where type='u'

xtype='u':表示所有使用者表;

xtype='s':表示所有系統表;

3.獲取所有欄位名:

select name from syscolumns where id=object_id('tablename') 

文章出處:http://www.diybl.com/course/7_databases/sql/sqlserver/200798/70978.html

查詢資料庫中所有表名,查詢表中所有欄位名

mysql 1.查詢資料庫中所有表名稱 select table name from information schema.tables where table schema 資料庫名稱 包含檢視 select table name from information schema.tables wh...

查詢資料庫裡所有表名和欄位名

在測試時,想要過濾查詢某個資料庫內的表名 只包含 autest 字元,在網上查了下 如何查詢整個資料庫表的 sql語句 如下 查詢資料庫裡所有表名和欄位名的語句 sql 查詢所有表名 select name from sysobjects where type u and name like aut...

ASP獲取資料庫表名,欄位名

在asp論壇上看到很多問怎麼獲取資料庫表名,欄位名以及如何對欄位進行刪除,增添的操作故寫此文。本人對sqlserver比較熟一些,故以sqlserver為列 set conn server.createobject adodb.connection conn.open server ip位址 pro...