use [master];
GO
USE [master]
GO
ALTER DATABASE [family] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
USE [master]
GO
EXEC master.dbo.sp_detach_db @dbname = N'family'
GO
