Addressing Orphaned Users

Use Microsoft SQL Server Management Studio or any other tool that executes SQL statements to address all orphaned users before starting or upgrading the StarTeam Server configuration. Use either the system administrator user name (sa) or windows authentication (under an administrative user account) to connect to the database and change the database context for the SQL console to the StarTeam database.

To address all orphaned users:

  1. Open a SQL console such as Microsoft SQL Server Management Studio or Enterprise Manager.
  2. Open a new query.
  3. Enter the following command to display the user names of all orphaned users: sp_change_users_login 'REPORT'.
  4. Enter the following to address the orphaned database owner (dbo). The database user is always orphaned when changing servers:
    sp_addlogin User Name , Password
    go
    sp_changedbowner User Name
    go
    sp_defaultdb User Name , Database Name

    User Name is the appropriate user name, Password is the appropriate password for the StarTeam Server, and Database Name is the StarTeam Server Database.

  5. For all other users who are returned as orphans, repeat the following commands for each of the orphaned users:
    sp_addlogin User Name, Password
    go
    EXEC sp_change_users_login 'Update_One', 'Orphaned User Name', 'New User Name'

    Where the Orphaned User Name is the orphaned user from the previous server and the New User Name is the new login created in the previous step.

  6. Enter the following command: sp_change_users_login 'REPORT'. This command should not return any rows.
For more information, refer to the Troubleshooting Orphaned Users section in the Microsoft SQL Server documentation.