Watch out for connection pooling.
-Mike
>>Yep, that's the way it's supposed to work.
>>Hmmm ... how are you determining that the connection is still open?
>
>With a stored proc I wrote that implements this query:
>
>select master.dbo.sysdatabases.Name,
> master.dbo.sysprocesses.login_time,
> master.dbo.sysprocesses.nt_username,
> master.dbo.sysprocesses.loginame,
> master.dbo.sysprocesses.program_name,
> master.dbo.sysprocesses.open_tran,
> master.dbo.sysprocesses.uid
> from master.dbo.sysprocesses
> join master.dbo.sysdatabases
> on master.dbo.sysprocesses.dbid
> = master.dbo.sysdatabases.dbid
> where master.dbo.sysdatabases.name = 'Northwind'
>
>This returns a result set with a single record for each active connection. Very helpful when you're trying to ensure that a LAN application is using no more than one connection, or when determining how many users are actively logged into an application (assuming each instance of the App is using one connection).