Is that connection your machine?
If so, is anyone else connected to the database at the time?
BTW, get rid of the
and DB_NAME(dbid)=;
line. Your example query won't execute in sql server the way you have it there.
EDIT ==============================
I found this with google (search phrase="sql server get all current connections").
DECLARE @SPWHO2 TABLE
([SPID] VARCHAR(1000),
[Status] VARCHAR(1000) NULL,
[Login] VARCHAR(1000) NULL,
[HostName] VARCHAR(1000) NULL,
[BlkBy] VARCHAR(1000) NULL,
[DBName] VARCHAR(1000) NULL,
[Command] VARCHAR(1000) NULL,
[CPUTime] VARCHAR(1000) NULL,
[DiskIO] VARCHAR(1000) NULL,
[LastBatch] VARCHAR(1000) NULL,
[ProgramName] VARCHAR(1000) NULL,
[SPID2] VARCHAR(1000) NULL,
[Request] VARCHAR(1000) NULL)
INSERT INTO @SPWHO2
EXEC sp_who2 'Active'
SELECT * FROM @SPWHO2
I'm the only person logged into my server right now, so it only shows one record, so I cannot determine if this will be what you need.