There is a knowledge base article from Microsoft, this article explains to us all the methods of transferring logins and even have the script methods, but the best method is this transfer login script: KB918992-transfer-logins. Microsoft in that script contains two stored procedures. Run that script on the database you want to migrate from, this will create the two stored procedures. In fact we really have to use one of them, the sp_help_revlogin, and what that really does for you is it's going to return to you just a bunch of t-sql statements that create logins. The only deference from scripting the logins out (by right clicking the login and "script loings as") is that is actually gives you the real password (the hash of the real password ;) ) and it also scripts every single login on the server, so you can copy the script for the login you want to migrate and execute it on the destination SQL server instance.
However, doing this, most probably will not avoid you from the orphan database users yielding from migrating a database through detach/attach or backup/restore; so you may still have to return to "Fix Orphan Users After Backup / Restore Databases Across Servers" previous post.
No comments:
Post a Comment