There is a good article at SQLServerCentral.com that helps you troubleshoot this error 15517 on SQL Server. I got this error when I tried to create a database diagram on one of my databases. The other databases were fine. The article is called Troubleshooting SQL Server Error 15517.
I read the article and executed the suggested queries. Sure enough when I executed the following query, the database in question had NULL for the dbo_login.
2 | 'SELECT ' '?' ' AS ' 'DBName' ', sp.name AS ' 'dbo_login' ', o.name AS ' 'sysdb_login' ' |
3 | FROM ?.sys.database_principals dp |
4 | LEFT JOIN master.sys.server_principals sp |
6 | LEFT JOIN master.sys.databases d |
7 | ON DB_ID(' '?' ') = d.database_id |
8 | LEFT JOIN master.sys.server_principals o |
10 | WHERE dp.name = ' 'dbo' ';' ; |
The solution was to substitute my database name in for “Example” in the following code from the article at SQLServerCentral.com. After running that I was able to create database diagrams for that particular database!
1 | ALTER AUTHORIZATION ON DATABASE ::Example TO sa; |