Wednesday, December 29, 2010

"Property Owner is not available for Database" In SQL Server 2008

Right click on a database and select properties - The following error appears:

"Property Owner is not available for Database '[TEST]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)"

I was logged in as SA so I was not sure why this was happening. So I ran this query t see exactly who owned the DB:

SELECT databases.NAME, server_Principals.NAME
FROM sys.[databases]
FULL JOIN sys.[server_principals]
ON [databases].owner_sid = [server_principals].sid


Turns out that the owner name spot was NULL, so nobody owned it - not even SA. This fixed it:

USE [ReportServerTempDB]
GO
EXEC sp_changedbowner 'sa'
GO

No comments:

Post a Comment