[dba-SQLServer] Users in SQL Server

jwcolby jwcolby at colbyconsulting.com
Mon Dec 5 06:27:13 CST 2011


Thanks Michael.

John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it

On 12/5/2011 12:55 AM, Michael Maddison wrote:
> Hi JC,
>
> I think this is the sproc you need.
> sp_change_users_login
> You'll need to look it up in help for usage details.
>
> You can use it to fix orphaned logins with the same name.
> Which is what you get when you restore a db on another system.  The
> names might be the same but the ID's underlying the names will be
> different.
> This sp fixes that issue.
>
> *Tip - you can save useful sprocs  as a template and reuse them when
> needed. There should be a tab on the right hand side of SSM Studio.
>
> If this doesn't solve your problem then I have misunderstood!
>
> Cheers
>
> Michael M
>
>
>   >I just discovered that if I delete the user out in that database and
> then set the rights through the user back in the server security stuff
> it happily accepts my changes and re-adds the user to the database.
>
> Unfortunately after I did this delete / re-add rigamarole I discovered
> that all of the rights to objects in the database were removed.  For
> example I had rights to execute stored procedures assigned to these
> users but after deleting the users the rights to execute were lost.
>
> Sigh.
>
> This SQL Server Users stuff is really developer unfriendly.
>
> John W. Colby
> Colby Consulting
>
> Reality is what refuses to go away
> when you do not believe in it




More information about the dba-SQLServer mailing list