Monday, March 19, 2012

How to detect active connection of a SQL Server?

Hi There,
Who know how to detect active connection to a particular SQL Server?
Eg: I have a SQL Server named MyServer and there are 3 computers link to
MyServer when my application start, but how do I know which of the 3
computers is linked to MyServer when application is running?
Thanks!
Wallace Wong
A2000 Solutions Pte Ltd
Blk 5 Ang Mo Kio Industrial Park 2A #07-17 TECH II Singapore 567760
Tel: (65) 6720 2000 Fax: (65) 6720 2987
Hi,
you can query the following objects:
SQL SERVER 2000:
SELECT * FROM sysprocesses
SQL SERVER 2005:
SELECT * FROM sys.dm_exec_sessions
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||"wallace" <wallace@.a2000.net> wrote in message
news:O7X575BUHHA.496@.TK2MSFTNGP06.phx.gbl...
> Hi There,
> Who know how to detect active connection to a particular SQL Server?
> Eg: I have a SQL Server named MyServer and there are 3 computers link to
> MyServer when my application start, but how do I know which of the 3
> computers is linked to MyServer when application is running?
>
> Thanks!
> --
> Wallace Wong
> A2000 Solutions Pte Ltd
> Blk 5 Ang Mo Kio Industrial Park 2A #07-17 TECH II Singapore 567760
> Tel: (65) 6720 2000 Fax: (65) 6720 2987
>
|||select count(*) from dbo.sysprocesses where status<>'Background'
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com

No comments:

Post a Comment