Maps an existing database user to a SQL Server login.


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. -- Showing a report of the current user to login mappings
  2. EXEC sp_change_users_login 'Report';
  3. GO
  4.  
  5. -- Automatically mapping a user to a login, creating a new login if it is required
  6. EXEC sp_change_users_login 'Auto_Fix', 'Mary', NULL, 'B3r12-3x$098f6';
  7. GO

URL: http://msdn.microsoft.com/en-us/library/ms174378.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.