From: Will on
TITLE: Microsoft SQL Server Management Studio


The database principal owns a schema in the database, and cannot be
dropped. (Microsoft SQL Server, Error: 15138)

I have an installer that is supposed to "clean up" the DB server before
an install. The installer checks for like object names and attempts to
clean house. All this is done via WMI objects. I have not been able to
find how to do this particular task with WMI - delete user schemas
prior to deleting users. Using management studio is easy and gets me
around the issue for testing but I need to do it programticaly - the
equilvilant of DROP SCHEMA [name]. Thanks!

-Will