Can not find a way to remove database in AMO (Analysis Management Objects). This code does not work:
if (svr.Databases.Contains(databaseName))
{
svr.Databases.Remove(databaseName, true);
svr.Update();
}
svr.Disconnect();
No error appears, but database still there. Same if I use Database object instead of database name. I was unable to find much about Databases.Remove method online.
I think that calling Remove() only removes it from the in-memory collection and doesn't reflect anything on the server.
I think what you're looking for is the Drop() method. So what you would do is something like:
Database object by calling a method like GetByName()Database object, call Drop() on itIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With