• This stored procedure maps an existing database user to a SQL Server login.

    It's true that is a bit comfusing, because the SQL login name (found under SQLserverX->sercurity->Logins and and the database user name (found under databaseX->security->users, for SQL Server are different things.

    If for example you have an SQL Server "sqlA" and a user with login name "nikos", whitch is the owner of some tables in "DbX", when backup and restore this database to a different SQL server, even if the "nikos" login name exists, it's not the same login (has different UID) with the previous and the "nikos" database name is orphaned.

    If you try to login as nikos and cast a "Select * from nikos.TableX" statement you ger an error.

    The procedure has the following syntax:

    p_change_users_login Update_One @DBUserName @SQLLoginName

    for more information you can go to:

    lloyd.tapper (10/5/2010)


    Nikos, I do pretty much the same thing that you do. However, could you explain Step #4 a bit more. The one thing I generally have trouble with is the logins and haven't gotten a satisfactory solution yet. What does this step do?

    Step 4: Finally, if the dev database is on a different SQL Servel like in my case is essential to map the login username of the 1st SQL to login username of the 2nd with the following command:

    sp_change_users_login update_one ,exampleusername,exampleusername

    go

    Regards

    Nikos