« Update Table Based on Join to Different Database | Main | Get statement from sqlhandle »
Wednesday
Aug182010

Fixing orphaned SQL user accounts

Ever refresh/restore a database only to find out your database logins don't match up with the database user accounts? I run the following query to simultaneously identify any database user permissions that aren't mapped to current database logins and also synch up the passwords to the appropriate logins. Copying/pasting the output to a new query window should get permissions back the way they should be (assuming you want to set the password to "opensezME!":

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>