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 Email validation in c# dot net core

 Use this regex /^_?[a-zA-Z0-9]([a-zA-Z0-9]*[._+-])*[a-zA-Z0-9_]+@(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.[A-...