檢視sql server系統表資訊

2021-07-05 16:44:47 字數 1604 閱讀 1111

select* 

from

sys.sysaltfiles

--主資料庫儲存資料庫的檔案

select* 

from

sys.syscharsets

--主資料庫字符集與排序順序

select* 

from

sys.sysconfigures

--主資料庫配置選項

select* 

from

sys.sysconstraints

--每個資料庫限制

select* 

from

sys.syscurconfigs

--主資料庫當前配置選項

select* 

from

sys.

sysdatabases

--主資料庫伺服器中的資料庫

select* 

from

sys.

syslanguages

--主資料庫語言

select* 

from

sys.

syslogins

--主資料庫登陸帳號資訊

select* 

from

sys.sysoledbusers

--主資料庫鏈結伺服器登陸資訊

select* 

from

sys.

sysprocesses

--主資料庫程序

select* 

from

sys.

sysremotelogins

--主資料庫遠端登入帳號

select* 

from

sys.

syscolumns

--每個資料庫列

select* 

from

sys.

sysfilegroups

--每個資料庫檔案組

select* 

from

sys.

sysfiles

--每個資料庫檔案

select* 

from

sys.

sysforeignkeys

--每個資料庫外部關鍵字

select* 

from

sys.sysindexes

--每個資料庫索引

select* 

from

sys.

sysmembers

--每個資料庫角色成員

select* 

from

sys.

sysobjects

--每個資料庫所有資料庫物件

select* 

from

sys.

syspermissions

--每個資料庫許可權

select* 

from

sys.

systypes

--每個資料庫使用者定義資料型別

select* 

from

sys.

sysusers

--每個資料庫使用者

參考:

sqlserver系統表作用

syscharsets 主資料庫 字符集與排序順序 sysconfigures 主資料庫 配置選項 syscurconfigs 主資料庫 當前配置選項 sysdatabases 主資料庫 伺服器中的資料庫 syslanguages 主資料庫 語言 syslogins 主資料庫 登陸帳號資訊 syso...

SQL Server 系統表簡介

系統目錄是由描述sql server 系統的資料庫 基表 檢視和索引等物件的結構的系統表組成。sql server 經常訪問系統目錄,檢索系統正常執行所需的必要資訊。1.sysobjects表 sql server 的主系統表sysobjects出現在每個資料庫中,它對每個資料庫物件含有一行記錄。2...

SqlServer檢視鎖表與解鎖

某些情況下,sqlserver的表會被鎖住,比如某個會話視窗有資料一直沒提交,視窗又沒關閉,這時表就會被鎖住 其他任何連線查詢表資料時都不會返回 這時需要手工殺掉產生死鎖的會話id,才能恢復正常 檢視被鎖表 select request session id spid,object name res...