Posts

Showing posts with the label Level 16

Drop User Error Msg 15138, Level 16, State 1, Line 5 The database principal owns a schema in the database, and cannot be dropped.

Image
Msg 15138, Level 16, State 1, Line 5 The database principal owns a schema in the database, and cannot be dropped. Things constantly change and one such thing is the addition and removal of users and servers.  In an attempt to remove a Machine account SQL Server login that was being replaced we know that removing a user from an Instance is not the same as removing them from a databases.  The Instance removal was simple however I came across this error message at the database level "The database principal owns a schema in the database, and cannot be dropped. (Msg 15138, Level 16, State 1, Line 5)".   Here are some steps to successfully review and drop the SQL Server user database logins: 1. What schema(s) does the user own? The following example finds the user and each schema owner. SELECT s . name , USER_NAME ( s . principal_id ) AS Schema_Owner FROM sys . schemas s -- WHERE s.principal_id = USER_ID('You user Name') ; B. Now re...

SQL Server backup to URL no mechanism to retry on backup errors Msg 3013, Level 16, State 1, Server, Line 1

Running Microsoft SQL Server 2016 (SP2-CU2) 13.0.5153.0 and below I can confirm that in August of 2018 there is currently no retry logic for Backup to URL.  If you use Backup To URL functionality natively or in conjunction with Ola Hallengren scripts   any blip, transient network issue/failure, or even Blob service issues/throttling during the backup process will cause a high level generic error failure code.  These errors are random at best, but the product unfortunately is working as designed and expected as retry logic is not currently built into the Backup To URL functionality.  It would be extremely beneficial and I would welcome the addition in any and all future SQL versions. Backup to URL was a new feature introduced in SQL Server 2012 so it has been around for 5+ years.  While this was a new feature, I would say very few truly use this even today.  If you are running an environment that is 100% Azure based then I feel that this is a feature tha...