/* Task for : Detach DB */
--------------------------------------------------------------------
-----code:start
--------------------------------------------------------------------
USE [master]
GO
ALTER DATABASE [DB_Test]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
USE [master]
GO
EXEC master.dbo.sp_detach_db @dbname = N'DB_Test'
GO
--------------------------------------------------------------------
-----code:end
--------------------------------------------------------------------
Result Messages:
Command(s) completed successfully.