SQL Server keeps telling me a database is in use when I try to drop it or restore it, but when I run this metadata query:
select * from sys.sysprocesses where d
i like this script. Do not struggle with killing..
use master alter database xyz set single_user with rollback immediate restore database xyz ... alter database xyz set multi_user