Wednesday, May 11, 2016

Microsoft Update KB3145126 kills DNS

I spent quite a few hours trying to figure out why DNS wasn't starting.  Finally found these links.

I uninstalled the update and DNS is working again.  Ugh!

Tuesday, May 3, 2016

SQL match orphaned users after DB restore

Restoring a DB to another DB server will not restore users to the SQL server itself, only the users in the DB.  But to use those users, they will need to be created in the SQL server and then mapped to the appropriate user in the DB.

Quick notes on how to do this.

List the orphaned users:
use RestoredDBName
EXEC sp_change_users_login 'Report'

Fix the users
use RestoredDBName
EXEC sp_change_users_login 'Auto_Fix', 'user'
EXEC sp_change_users_login 'Update_One', 'OrphanedUser', 'OrphanedUser'

More Details here.