Suppose, We need to block the access to current database and for that decided to make the db offline.
For this, right click db->task-> offline.
But it won't work, if some connection still open.
ALTER DATABASE <dbname> SET OFFLINE WITH
Now SQL Server immediately take database to offline by closing an existing connection and rollbacks the transactions, which are not completed till now.
SQL Server Tips · · · ·