Get the App
SLTechnology News&Howtos  ›  Database  › 

[Case] the SQL SERVER property OWNER is not available for database xxx.

Shulou Source: shulou.com Published: 2022-06-01 06:06:02 10月02日 Update

Reprinted from Xiaoxiang Hermit:

GOhttps://www.cnblogs.com/kerrycode/archive/2015/10/30/4924412.html

Today encountered a case: right-click database properties when the following error prompt:

The attribute Owner is not available for database xxx, the object may not have this attribute, or it may not have sufficient access rights to retrieve it.

When using the script to view the Owner for this database, the Owner is null. The specific reason is because the Owner of the database is an account of a system administrator. Since the colleague left the company, the system administrator who took over cleared the account, so the above error occurred. At this point with the following script query, you will find that the Owner is null value.

SELECT d.name ,

owner_sid ,

l.name

FROM sys.databases d

LEFT JOIN sys.syslogins l ON l.sid = d.owner_sid

WHERE d.name='DataBaseName';

Just change the database Owner to sa or another sysadmin account.

USE DataBaseName;

GO

EXEC sp_changedbowner 'sa';

Tags: Data database attributes account administrator system script error management reason colleague object permission case role hermit Xiaoxiang time out prompt query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB Shulou Technology Redmi Microsoft