Showing posts with label MS SQL. Show all posts
Showing posts with label MS SQL. Show all posts

Wednesday, May 14, 2008

Fixing a DB User After a MS SQL Server Restore

Situation: After running a database restore a database user is no longer linked to a SQL Server login.

Solution: Run the following:
   1: USE [%DB NAME%]


   2: EXEC sp_change_users_login 'Auto_Fix','%USERNAME%'


   3: GO






Details:

MS Technet: sp_change_users_login (Transact-SQL)