Ask Paula!

...bringing you notes from the field...

  Home  |   Contact  |   Syndication    |   Login
  147 Posts | 5 Stories | 133 Comments | 0 Trackbacks

News

Copyright © 2008-2018 Paula DiTallo

Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

.NET Development

Enterprise Integration

Entertainment - Games

Java Development

Mobile/PDA Development

Professional Affiliations

This usually happens when you restore a database. For example, you restore a copy of production database X to your QA server. In essence, you have overwritten the user info of that specific database with what exists in production. This creates an orphan user -- where you have no login associated with a user in that database on a server that once associated that user with the old copy of the database.

Here is what to do fix the issue:

1.  Validate that what you think is the problem is the  problem. Do this by listing the known orphans. You may have others show up--but be sure the id you are interested in is on the list:

use [your database instance]

go

EXEC sp_change_users_login 'Report'

2. Fix the broken login:

EXEC sp_change_users_login 'Auto_Fix', 'orphan username'


posted on Monday, June 30, 2014 3:32 PM