Wednesday, March 21, 2012

How to get the count of connection?

Can we use Sql Profile to get the count of connections to SQLServer?No, but you can get that data from System Monitor [perfmon.exe]
(MSSQL:General Statistics | User Connections) or simply by querying the
server. In SQL 2000 you would query the master.dbo.sysprocesses system
table (or better yet execute system procs sp_who or sp_who2) like this:
select * from master.dbo.sysprocesses;
go
exec sp_who;
go
exec sp_who2;
go
In SQL 2005 you would query the sys.dm_exec_sessions or
sys.dm_exec_connections dynamic management views (which gives you
similar info) like this:
select * from sys.dm_exec_sessions;
go
select * from sys.dm_exec_connections;
go
Hope this helps.
*mike hodgson*
http://sqlnerd.blogspot.com
ad wrote:

>Can we use Sql Profile to get the count of connections to SQLServer?
>
>sql

No comments:

Post a Comment