The database diagram support object cannot be installed because the database does not have a valid owner _mssql
Source: Internet
Author: User
After you create a new database or attach a database, you want to add a relational table, resulting in the following error:
The database diagram support object cannot be installed because the database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or alter
The authorization statement sets the database owner to a valid logon name, and then adds the database diagram support object.
Changing in the first way is not possible, and the owner of the file is also SA. A user gives a way to run the following command:
ALTER AUTHORIZATION on Database::mydbname to SA
By modifying the mydbname to the actual database name, you can set the owner to SA.
There is another workaround:
1, set the compatibility level is 90 (2005 is 90) (2000 is 80) Use [master]
Go
EXEC dbo.sp_dbcmptlevel @dbname = ' database name ', @new_cmptlevel =90
Go
Or select the database you restored, right-click, select attribute-> option-> compatibility level, choose sqlserver2005 (90) and then OK.
At this point, you will be prompted to expand the database Diagram node under the database, "This database lacks one or more supporting objects that are required to use the database diagram.
Whether to create ", select" Yes ".
2, through the above methods of operation, if the problem persists, in the following ways to continue Select your database and select "Security"-> "user", select dbo, open the Properties page, if the login name is empty, create a new query, and then
Use [your database name]
EXEC sp_changedbowner ' sa '
After successful execution, you will then select the Database Diagram node and prompt "This database is missing one or more supporting objects that are required to use the database diagram and whether to create".
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.