1、查詢當前資料庫中的使用者表
select * from sysobjects where xtype='u';
2、獲取sql server允許同時使用者連線的最大數
select @@max_connections;
3、獲取當前指定資料庫的連線資訊
select * from master.dbo.sysprocesses where dbid in(select dbid from master.dbo.sysdatabases
where name='yourdatabasename'
)--根據需要更改yourdatabasename
4、獲取當前sql伺服器所有的連線詳細資訊 查詢結果包含了:系統程序和使用者程序。如果只是想查使用者程序的話則需採用下面的方法5
select * from sysprocesses
5、獲取自上次啟動 sql server服務 以來連線或試圖連線的次數
select @@connections
sql server2000 系統表常用操作
得到資料庫中所有使用者表 select name from sysobjects where xtype u and name dtproperties order by name 得到資料庫中所有使用者檢視 select name from sysobjects where xtype v and...
總結了幾個常用的sql server系統表的使用
檢視表的屬性 select from sysobjects where name section 用法 if exists select from sysobjects where name section and xtype u drop table table1 go create table1...
sqlserver系統表作用
syscharsets 主資料庫 字符集與排序順序 sysconfigures 主資料庫 配置選項 syscurconfigs 主資料庫 當前配置選項 sysdatabases 主資料庫 伺服器中的資料庫 syslanguages 主資料庫 語言 syslogins 主資料庫 登陸帳號資訊 syso...