Wrong Logion Name after restore

  • Hello,

    I restored a production DB on a test environment, but I got this problem ;

    The DBO user name is associated with my application Login Name, ie TOTO

    but, my application user, TOTO, is associated with login name SA.

    so DBO <-> TOTO

    TOTO <-> SA

    It should be

    DBO <-> SA

    and TOTO< <-> TOTO

    Sql Server does not allow me to change that.

    I tried the program Sync SQL logins.exe, that see the problem, but cannot solve it...

    Anybody got an idea ?

    (Sorry, but I'm really not an expert)

  • Check sp_changedbowner in Books Online.

     

    --------------------
    Colt 45 - the original point and click interface

  • but my user is not orphaned.

    There is just a mixture.

  • sp_changedbowner changes the owner of the current database, nothing to do with orphaned users.

    Read the documentation in Books Online.

     

    --------------------
    Colt 45 - the original point and click interface

  • If you restored the database to a DIFFERENT server:  After the restore, you will need to synchronize the logins/users data.  To do this, login to the Query Analyzer and run the following query for EACH user in the database:

    USE DATABASENAME

    go

    EXEC sp_change_users_login 'Update_One', 'USERNAME', 'LOGINNAME'

     

    Hope this helps.  For more info on this command, consult BOL.


    Have a good day,

    Norene Malaney

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply