SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘database owner’

BUG: DOC Error: Documentation Incorrectly States that DB_Owner role has Restore Database Permissions

Symptoms
SQL Server 7.0 Books Online states that a member of the db_owner role has RESTORE DATABASE permission. However, when a member of the db_owner fixed database role tries to restore a database, the following error message occurs:

Server: Msg 3110, Level 14, State 1, Line 1
Only members of the sysadmin role or the database owner of ‘Database_Name’ can run RESTORE DATABASE.
Server: Msg 3013, Level 16, State 1, Line 1
Backup or restore operation terminating abnormally.
Resolution
Members of the db_owner fixed database role do not have RESTORE permissions. This behavior is by design. Fixed database role membership can only be checked when the database is accessible and undamaged. Because this is not always the case when the RESTORE statement is executed, members of the db_owner fixed database role do not have RESTORE permissions.

BUG: Database Restore May Result in DBO Mismatch if DBO Has Been Changed More Than Once

Symptoms
Restoring a database backup that was created while a previous login owned the database may result in a database owner (DBO) mismatch. After the database is restored, the sp_helpdb and sp_helpuser procedures may return different DBOs for that database.
Resolution
The database backup contains DBO information from before the ownership change, while the master database contains the current ownership information. The restore operation does not reset the database owner.