0

We are using Microsoft SQL Server 2016 Management Studio (version 13.0.16106.4) connecting to an instance of SQL Server 2016 running on Windows 2016. The authentication is "SQL Server Authentication" and the username has admin permissions.

When we try to get the ER-diagram of a database, by right clicking "Databases > the database > Database Diagrams" and selecting "New Database Diagram", we always get the following error:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Could not obtain information about Windows NT group/user 
'WIN\Administrator', error code 0x534. (Microsoft SQL Server, 
Error: 15404)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.5101&EvtSrc=MSSQLServer&EvtID=15404&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

And if we try clicking on "Install Diagram Support", it pops the same error message as above.

With the hyperlink in the error message, we got landed at a webpage for shopping, so we guess the original help page have been removed.

We are new to this area, so we highly appreciate any hints and suggestions.

0

1 Answer 1

2

Windows error code 0x534 indicates an invalid SID, likely an invalid database owner. Change the database owner to a valid login to keep the SSMS diagram tool happy:

ALTER AUTHORIZATION ON DATABASE::YourDatabase to ValidOwnerLogin;
5
  • The SQL Server runs on a virtual machine, and its hostname was changed from WIN to MSSQLV before. And now, the database property still shows owner WIN\Administrator while the Management Studio connection shows MSSQLV\Administrator. Maybe this is the conflict. We tried ALTER AUTHORIZATION ON DATABASE::[database] to [MSSQLV\Administrator];, the SQL command succeeded, but the owner property stays the same as before.
    – James
    Sep 6, 2023 at 16:58
  • @James, did you refresh SSMS after changing the owner? Verify the owners are the same with USE YourDatabase;SELECT SUSER_SNAME(owner_sid) FROM sys.databases WHERE database_id = DB_ID();SELECT SUSER_SNAME(sid) FROM sys.database_principals WHERE name = N'dbo';
    – Dan Guzman
    Sep 6, 2023 at 18:52
  • The name shown to you in SSMS is what is resolved when the SID is checked against the system metadata in sys.server_principals for logins or sys.database_principals for users. Since these mappings are by SID, which doesn't change when a server is renamed, the lookup works just fine but shows the original name. You can change this by altering the name. Sep 6, 2023 at 21:44
  • @SeanGallardy, do you think changing the login name will correct the SSMS digram issue (like it does for a SID mismatch for the database owner)?
    – Dan Guzman
    Sep 6, 2023 at 22:31
  • It's possible, it seems like whatever functionality the diagrams may be done through name only. Sep 6, 2023 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.