There are other methods for moving logins, like using DTS/SSIS, but here is a Quickie with T-SQL. If we use DTS between diff version of SQL Servers, the Passwords will be copied over but the Original SID’s will not be and hence the database users will be considered ORPHANED. So you have to follow the T-SQL path to re-map the users.

Moving logins has been easier with these scripts from Microsoft, to transfer the logins between SQL Servers.

The Scripts (sp_hexadecimal and sp_help_revlogin) are located here http://support.microsoft.com/kb/246133

  1. Remember the Order of Execution of Scripts: (though doesn’t matter)
    • sp_hexadecimal goes first
    • sp_help_revlogin goes next
  2. Change the Result to TEXT (IMP)
  3. Run this command : EXEC master..sp_help_revlogin
  4. Copy the Results or save them and
  5. Execute the saved/copied results from the Script on the new Query window.
  6. The Logins and passwords should be created in the server, if not already present.
  7. OR Just copy the logins that is required
  8. verify database users-mapping with
  • use <database name>
  • exec sp_change_users_login ‘report’
  1. To check for orphaned users. This will list out to report all orphaned users in the database.
    If there is a orphaned user in the list :  use the below Query to re-map the Logins
    sp_change_users_login ‘update_one’,'username’,'username’;
© 2010 D B A N A T I O N Suffusion WordPress theme by Sayontan Sinha
Better Tag Cloud