RESTORE DATABASE [databasename] WITH RECOVERY
USE master; GO ALTER DATABASE Database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
USE master; GO ALTER DATABASE Database_name SET MULTI_USER; GO