I am trying to drop a user-defined database, like so:
create database demo;
drop database demo;
But I get the error
Cannot drop the database 'demo', because it does not exist or you do not have permission.
I am trying to drop a user-defined database, like so:
create database demo;
drop database demo;
But I get the error
Cannot drop the database 'demo', because it does not exist or you do not have permission.
One way to sort this out might be to run
SELECT name FROM sys.databases
to see if the database does exist.
Some helpful tips from MSDN:
DROP DATABASE, the database
context of the connection cannot be
the same as the database to be
dropped. You could change your
context to, for example USE master
before running DROPDROP DATABASE, at a
minimum, a user must have CONTROL
permission on the database.You might find some other useful information there that applies to your specific situation.