June 3, 2009 at 2:45 pm
I restored a database dump to a new instance in my test environment. I created a login and tried to map it to an existing user in the database, however when I try to do so I get an error:
Rename failed for User 'Username', (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
User, group, or role 'user' already exists in the current database. (Microsoft SQL Server, Error: 15023).
When I try to delete the user, I also get an error:
Drop failed for User 'Username', (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138).
Please help.
June 4, 2009 at 7:24 am
Since the user owns a schema in the database, you need to find which schema it owns and change ownership, then the user can be dropped.
June 4, 2009 at 8:23 am
Thak you.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy