Script to drop all connections to a Database

There are instances when we may have to drop all the connections to a database for example to rename a database. The script below can be used to drop all the connections to the database. 

DECLARE @dbname nvarchar(128)

SET @dbname = ‘DB name here’ — db to drop connections DECLARE @processid int SELECT @processid = min(spid)

Read More . . . 

4 Comments

  1. Pretty part of content. I simply stumbled upon your weblog and in accession capital to claim that I acquire actually loved account your blog posts.
    Anyway I will be subscribing to your feeds and
    even I success you get admission to constantly fast.

Leave a comment