Comments on: User Resynch https://thomaslarock.com/2009/08/user-resynch/ Thomas LaRock is an author, speaker, data expert, and SQLRockstar. He helps people connect, learn, and share. Along the way he solves data problems, too. Tue, 15 Sep 2009 00:40:02 +0000 hourly 1 https://wordpress.org/?v=6.7.2 By: Thomas LaRock https://thomaslarock.com/2009/08/user-resynch/#comment-907 Tue, 15 Sep 2009 00:40:02 +0000 http://thomaslarock.com/?p=2625#comment-907 In reply to Jonathan Kehayias.

yeah, that would not be allowed in our shop. different logins for each environment.

]]>
By: Jonathan Kehayias https://thomaslarock.com/2009/08/user-resynch/#comment-906 Mon, 14 Sep 2009 16:30:13 +0000 http://thomaslarock.com/?p=2625#comment-906 Tom,

I am behind on blog reading as you can probably tell, but I work just like Andy Warren in this case. We use the same login names for our Production, Development and Test environments. When I create a login in production, I immediately script that login out with the SID and use the scripts to create the login on the other servers. Then I change the password on the login and make any needed changes to that environment. This way when you restore the databases the users map to the logins properly.

]]>
By: Thomas LaRock https://thomaslarock.com/2009/08/user-resynch/#comment-905 Tue, 01 Sep 2009 02:04:45 +0000 http://thomaslarock.com/?p=2625#comment-905 In reply to Andy Warren.

andy, do you (and others who responded) mean to imply that you have the exact same logins with the exact same names on your servers? otherwise i am not seeing how you would be keeping the SID’s in line, perhaps i am missing something and you are manually setting the SID?

here we have different logins for each environment, which is why we started down the path many years ago of capturing the syslogins nightly in order to do the resynch after a restore between prod and test. i am not sure it ever occurred to me to force the SID’s to match, mostly because the login names are different.

]]>
By: Lori https://thomaslarock.com/2009/08/user-resynch/#comment-904 Fri, 28 Aug 2009 22:21:17 +0000 http://thomaslarock.com/?p=2625#comment-904 I do the same thing as Tim and have a procedure that (eegads!) cursors through the users and runs the sp_change_users_login against them. I keep copies of the output of help_revlogin as well.

]]>
By: Joe Janhonen https://thomaslarock.com/2009/08/user-resynch/#comment-903 Mon, 24 Aug 2009 01:48:57 +0000 http://thomaslarock.com/?p=2625#comment-903 Ditto here, sp_help_revlogin is my tool of choice for keeping the users, their passwords, and sids in sync. It can be found at http://support.microsoft.com/kb/918992.

]]>
By: Jose Oyervides https://thomaslarock.com/2009/08/user-resynch/#comment-902 Sat, 22 Aug 2009 00:23:27 +0000 http://thomaslarock.com/?p=2625#comment-902 I use a Powershell script to recreate the users first and then another script to add the user to its roles.

Every night I generate the scripts to re-create the users, roles, etc, so I have them ready to use in situations like this.

]]>
By: Tim Ford https://thomaslarock.com/2009/08/user-resynch/#comment-901 Fri, 21 Aug 2009 21:35:47 +0000 http://thomaslarock.com/?p=2625#comment-901 I have a script based off of sp_change_users_login and sp_help_revlogin. Am on road for next week, but think if you go out to mssqltips.com and search on my name + orphan you’ll find it.

]]>