I'm trying to delete a content database (having no sites) using below code:


where "_oDB" is object of SPContentDatabase and the content database exists.

However, I'm getting below error:

An object in the SharePoint administrative framework, \"SPContentDatabase Name=5003C\", could not be deleted because other objects depend on it. Update all of these dependants to point to null or different objects and retry this operation. The dependant objects are as follows: \r\nSPWebApplication Name=Test - 2020\r\n

Farm Configurations:

  • SharePoint 2019

  • SQL Server 2017

Any help is much appreciated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.