Map new user to login

Discussion in 'Databases' started by lrodrigues, Aug 4, 2010.

  1. Hello,
    I am trying to execute the following command:
    alter user sptransUsr with login=DB_11449_mantrax_user, DEFAULT_SCHEMA=spt
    and am getting the following error message:
    Msg 33018, Level 16, State 1, Line 1
    Cannot remap user to login 'DB_11449_mantrax_user', because the login is already mapped to a user in the database.
    The user dbo is mapped to my login with default schema dbo. I need to change the default schema upon login, this is why I thought I could map a new user. Is it possible?
    On the other hand I can't remap user dbo to my schema spt, which would be another way of changing the deault schema.
    Thank you,
    Luiz
     
  2. Ray

    Ray

    No. I'm afraid each database will only have one database user. And that user will have dbo to that database. Furthermore, the db user name that our system creates cannot be modified, altered, or changed.
     
  3. Ok. I guess you mean each database will have a single login that can't be changed, correct? I'm making a distinction between database login and user. I suppose other users could be created but that wouldn't help.
    So, if I understand correctly there is no way to solve my problem which is to change the default schema after login, for all database access. My site was designed in such a way that all database objects referenced reside within a schema, and that schema is never referenced. I will have to modify all the source code that references database objects, which of course is a daunting task.
    Thanks anyway.
    Luiz
     

Share This Page