Tuesday, June 10, 2014

Dead in the Water

Definition:  Not moving (used only when a vessel is afloat and neither tied up nor anchored).

Often times, you'll need to restore a production database to a development and test instance so that developers have current data for their testing.  If the database has local database users, these accounts will need to be 'fixed' so they are properly associated with the local SQL logins on this other instance.  Until these accounts are fixed, your developers will be 'Dead in the Water'.


To see the accounts that need to be fixed, execute:

sp_change_users_login 'report'

To fix the accounts, run:
exec sp_change_users_login 'UPDATE_ONE','AccountName','AccountName'


Once these accounts are fixed, your developers can "Shift Colors" and get underway!