How do you kill all current connections to a SQL Server 2005 database?

asked17 years ago
last updated15 years ago
viewed433.9k times
Up Vote294Down Vote

I want to rename a database, but keep getting the error that 'couldn't get exclusive lock' on the database, which implies there is some connection(s) still active.

How can I kill all the connections to the database so that I can rename it?