How to resolve Microsoft SQL Server Error 15023 "User already exists"

Microsoft SQL Server Error 15023

When you restore a database from backup to your SQL server in test environment, you will try to add Role to a restored database for user. At this time you may get the error message:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo). User, group or role 'UserName' already exists in the current database. (Microsoft SQL Server Error" 15023). (read more...)

MarkiMarta.com. Notes of web-specialist
Since 2009