April 15, 2016 at 5:17 am
Hi,
I've restored a back up to my Test server but I cannot add the role db_owner to my user. It fails with error:
Add member failed for DatabaseRole 'db_owner'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.2000.8+((SQL14_RTM).140220-1752)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Add+member+DatabaseRole&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission. (Microsoft SQL Server, Error: 15517)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.4213&EvtSrc=MSSQLServer&EvtID=15517&LinkId=20476
Image:
https://www.dropbox.com/s/kjnz4qda4upa3as/error.png?dl=0
Best Regards,
Ashkan
April 15, 2016 at 5:20 am
Sorry for the bad topic name.
I tried 3 times to save my question and it succeeded, but then it has been removed from the forum after 10 second. I think something is wrong here today 🙁
Best Regards,
Ashkan
April 15, 2016 at 6:27 am
Did you change the owner of the database? try executing exec sp_changedbowner 'sa' in the restored database and then try again.
April 18, 2016 at 1:47 am
Thanks Arthur! Worked like a charm 🙂
Best Regards,
Ashkan
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply