TerrenceRyan.com

I'm a 35 year old redhead geek from Philly.
I'm currently a Developer Evangelist for Adobe.
Also the author of Driving Technical Change

Re-associate Microsoft SQL Login with a Database User

2 Comments

I've had to search for this several times in the last few weeks, (ever since Mark Drew pulled me into the dark side that is local development.) I figured if I blog it, I'll always have the answer at hand.

If you are restoring a Microsoft SQL database from a backup onto a new server, and you need to re-associate the server login name to the database username, you need to call the "sp_change_users_login" stored procedure. That will allow you to reconnect them.

2 responses so far ↓

  • 1 JohnEric

    I always do a search on 'orphaned users' in SQL Server Books Online
  • 2 J.Cruz

    Another option i just read about was if you create a user with a known SID (i believe it's an option of the CREATE LOGIN or sp_add_login procedures in SQL 2005 and SQL 2000 respectively).

    That way you can re-create the login on the new SQL Server with the right SID and SQL will automatically associate the Login with the DB user.

    Not as useful in a DR scenario; the sp_change_users_login procedure is still your best bet.

Leave a Comment









Categories

Monthly Archives

Tag Cloud

coldfusion web development flex coldfusion builder appearances squidhead coldfusion builder extensions higher ed flash builder air mobile android adobe apptacular html5 driving technical change running a coldfusion shop adobemax06 movable type flash catalyst flash blackberry adobemax07 adobemax08 hero finicky css adobemax09 holy crap i’m a mobile developer centaur basecamp cfc unfuddle motorola metablog irrational characters ios git evangelism devices code reviews ant wharton subversion security phonegap philly philadelphia multidevice knowledge@wharton jobs browserlab adobemax10 adobe tv unfuddlecfc svnauth.cfc semantic html semantic html responsive web design qnx nlb linux jquery mobile java it github flexorg fireworks edge eclipse dreamweaver apps apple adobemax11