SQL 中怎麼查詢乙個資料庫中一共有多少個表

2021-06-19 02:14:35 字數 676 閱讀 5569

剛才那個是使用者表,下面這個是系統表加使用者表:

select count(*) 總表數 from sysobject s where xtype in('u','s')

總檢視數:select count(*) 總檢視數 from sysobjects where xtype='v'

總儲存過程數:select count(*) 總儲存過程數 from sysobjects where xtype='p'

總觸發器數:select count(*) 總觸發器數 from sysobjects where xtype='tr'

資料庫作業: select count(*) from msdb.dbo.sysjobs 

sysobjects 表引數說明----

d = 預設值或 default 約束

f = foreign key 約束

l = 日誌

fn = 標量函式

if = 內嵌表函式

p = 儲存過程

pk = primary key 約束(型別是 k)

rf = 複製篩選儲存過程

s = 系統表

tf = 表函式

tr = 觸發器

u = 使用者表

uq = unique 約束(型別是 k)

v = 檢視

x = 擴充套件儲存過程

ASP中乙個資料庫操作類

是否隱藏錯誤資訊的選項,true 顯示,false 隱藏 const is debug true class conn public objcn private connstr private errinfo private executecnt private time start private...

SQL中複製乙個表到另外乙個資料庫中

有兩個資料庫分別叫dberp和dbtest,dbtest中有個表叫u 物料編碼,現在我想將此表複製到dberp中,即 dberp中也弄個u 物料編碼表。在sql server management studio中,使用 sql server匯入和匯出嚮導 可以很容易地複製表。如果一定要使用語句,假設...

Django中乙個專案使用多個資料庫

1.修改專案的 settings 配置 在 settings.py 中配置需要連線的多個資料庫連線串 2.設定資料庫的路由規則方法 在settings.py中配置database routers project 建立的django專案名稱 project name database router 定...