作者hpo14 (陌生)
看板C_Sharp
標題Re: [問題] 請問如何用comboBox下拉式選單選取資料 …
時間Mon Aug 18 19:50:06 2008
: 只是不知道該如何取得每個資料表的名字
不知道妳所謂的抓名字,是要從資料庫抓,還是說妳已經把全部的表塞進 DataSet
了,如果是後者..那應該可以用迴圈去抓出 Tables 的名字
以下是 google 到的查詢有哪些資料表的語法..
= SQL Server
1.取得資料庫表單數量
select count(*) as totaltablenumber
from sysobjects
where xtype = 'U';
2.取得資料表名稱(tablename)及欄位數量(columnnumber)
select name as tablename, info as columnnumber
from sysobjects
where xtype = 'U';
3.取得某一資料表內所有欄位名稱
select b.name
from sysobjects as a, syscolumns as b
where a.xtype = 'U' and a.id = b.id and a.name='資料表單名稱';
3.1 取得某一資料表內所有欄位名稱
EXEC sp_columns 表單名稱
= MySQL
1.取得資料庫表單數量
show tables; 之後再加總
2.取得資料表名稱及欄位數量及所有欄位名稱
describe 表單名稱; 之後可取得資料庫欄位名稱及數量
= MS ACCESS
1.取得資料庫表單數量
Select count(*) as TotalTableNumber
Ffrom MSysObjects
where Type = 1 and Flags = 0;
2.取得資料表名稱
Select name as tablename
From MSysObjects
where Type = 1 and Flags = 0;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.59.78.243
推 teamspike:thx a lot 08/19 11:37
推 tomex:效能評比: count(*) < count(column1) < count(1) 08/19 23:34