Wednesday, June 22, 2016

SQL Server error Cannot execute as the database principal because the principal “dbo” does not exist

After restoring adventure works database, when trying to see database diagrams I got an error Cannot execute as the database principal because the principal “dbo” does not exist.

The solution is to reassign database owner using script
use [databasename] EXEC sp_changedbowner 'sa'

More Info

No comments:

Regex obfuscate email

 Use this code in C# to obfuscate email using regex // Online C# Editor for free // Write, Edit and Run your C# code using C# Online Compile...