Home Forums SQL Server 2008 SQL Server 2008 - General Hi, I have migrated a database from sql server 2000 instance to another sql server 2000 instance.So i have taken the backup of the Tenu001 database and i have restored it onto the target instance.Then later on i tried to transfer the logins and passwords from the source instance to the target insta RE: Hi, I have migrated a database from sql server 2000 instance to another sql server 2000 instance.So i have taken the backup of the Tenu001 database and i have restored it onto the target instance.Then later on i tried to transfer the logins and passwords from the source instance to the target i

  • Please find the relevant steps in users and login mapping process:

    1) When we restore a database, the users associated with the database gets restored.

    2) using sp_help_revlogin, we generate the script for Logins and run this script on the new instance.

    3) Now we have the users and logins both on the new instance but they are not mapped.

    4) To check for orphan users, run this script:

    sp_change_users_login @action='report'

    This needs to be run within the desired database context.For example if want to check orphan users for Pubs database then run within it.

    5) Now to map these orphan users with their respective logins, we need to run this command:

    USE PUBS

    GO

    sp_change_users_login @Action='update_one',

    @UserNamePattern='TestUser',

    @LoginName='Testlogin'

    GO

    6) The above steps will fix the issue. Run the script for checking the orphan users again and validate that no more users are orphan.