Orphan Users

  • Hi,

    can any body tell me why sid got different\changed for logins and users,

    whenever we copy and restore any database from one instance to another.

    Thanks

    Bhuvi

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Because the SID is unique and specific to each instance.

    Here's an explanation:

    http://www.mssqltips.com/tip.asp?tip=1590

    Here's an article about fixing the problem

    http://support.microsoft.com/kb/918992

  • I keep a restore script for each main database and include at the end the lines

    USE databasename

    EXEC sp_change_users_login 'Update_One', 'username', 'username'

    where databasename is my database and username is a sql login in that database.

    Put one sp_change_users_login line for each sql database login that needs re-connecting to its user.

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

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