How to: attach a SQL Server login to a database user.

by Remco Ros 5. February 2009 20:40

I sometimes need to attach a SQL Server login to a lost database user.

This is the way to do it:

 

   1: sp_change_users_login 
   2:     @Action = 'Update_One',
   3:     @UserNamePattern = 'username', 
   4:     @LoginName = 'login name'
   5:     

 

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

Tags: ,

SQL Server

Comments

About me

Remco Ros

Hey, i'm remco, currently working as a .Net developer in the netherlands, interested in new technologies, physics, and spirituality.

Have a question? contact me.