USE master;
GO
ALTER DATABASE Test
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
DROP DATABASE Test;
GO
#LIST DATABASES
SELECT name, database_id, create_date FROM sys.databases ;
GO
USE master;
GO
ALTER DATABASE Test
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
DROP DATABASE Test;
GO
#LIST DATABASES
SELECT name, database_id, create_date FROM sys.databases ;
GO