Wednesday 12 August 2015

How to Synchronize users in bulk to a newly created geodatabase in SQL Server

There is often the need to create or restore a geodatabase in SQL Server, whether it is for testing or a new production database.  Using the sp_change_users_login procedure works well to synchronize one or two users.  When there are a lot more, this method may not be the best way to go.

Follow these simple steps to synchronize your users in bulk:

In SQL Server Management Studio:

    Right click on the original database > Tasks > Generate Scripts.
   
    You only want to sync users so only check ‘Users’ in the Choose Specific Objects section.
   
    The Set Scripting Options section allows you to specify where you want to save the SQL output.  In most cases I send it to the clipboard.
   
    Click next a few times and then finish.
   
    Open a new query window and paste (or load) in your newly generated SQL script.  You will need to change the USE [‘original_db_name’] at the top to match the new database you want to sync the users to.
   
    Execute the script.
   
    Now make some test connections as the newly synchronized users .
   
Thanks.
NJ

No comments:

Post a Comment