I am currently connected to a customer database via the front end using there application and I run the following query which displays active connections:
SELECT DB_NAME(DBID) AS DBNAME,
       COUNT(DBID)   AS NUMBEROFCONNECTIONS,
       LOGINAME      AS LOGINNAME
FROM   SYS.SYSPROCESSES
WHERE  DBID > 0
GROUP  BY DBID, LOGINAME 
I have the ability to run SQL in the front end of the application therefore how can i kill all active connections based on a DB_NAME(DBID) = 'CustomerDB'
using SQL? 
 
     
     
    