1

This question already has an answer here:

I have a problem. I have a Windows user [domain\user] on my instance that has access to some database. I want to change the default schema for that login. I can do this when I create some test login and user in the database but not for my Windows user:

ALTER USER [MFG\giorgi.nakeuri] WITH DEFAULT_SCHEMA=[TBBS]

...results in:

Cannot alter the user 'MFG\giorgi.nakeuri', because it does not exist or you do not have permission.

But when I am trying to add it:

CREATE USER [MFG\giorgi.nakeuri] FOR LOGIN [MFG\giorgi.nakeuri]

I get:

The login already has an account under a different user name.

When I observe login in properties it has a check on the database and both user and default schema are dbo. But I can not change any of those from that window. I am connected to instance with this windows user and login server role is all: public, securityadmin, serveradmin, setupadmin, sysadmin.

marked as duplicate by Paul White sql-server May 20 '16 at 15:45

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

-1

It looks like based on your error that the user you are trying to create a login for already has a login in that database with another name, so you are effectively "double mapping" them.

If you have access to SSMS you can see what their mapping is by using the Object Explorer and navigating the following path: Security -> Logins -> Double click on the username

This should pop up a GUI, you can see the "User Mapping" in the top left hand corner, this should show you to whom the user is mapped.

  • Yes it has as I said in the question. It is dbo. But how can I change that? I can not delete dbo user from database?! – Giorgi Nakeuri May 17 '16 at 18:56
  • As I guess I can not do this for admin login? I should add some other windows login and then add user based on that login to the database? – Giorgi Nakeuri May 17 '16 at 18:59
  • Yes I can do this manually adding windows login and user with that loging. Then I can change the default schema of that user. It seems like I can not do this for admins. – Giorgi Nakeuri May 17 '16 at 19:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.