title: How to correct SQL server mapping after database restoration?
body: <p>The program I code uses an SQL server DBMS, with 3 databases : DB, Archives, HL7.
  After a restoration of the 3 databases in a new PC, I get an error in entity framework while accessing to the HL7 database :</p>
  <blockquote>
  <p>opening of sa user session failed</p>
  </blockquote>
  <p>I searched dall differences between the 3 databases in SQL Server Management Studio and found this one:</p>
  <p><a href="https://i.stack.imgur.com/4zeu6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4zeu6.png" alt="difference" /></a></p>
  <p>When I try to correct this problem, I get this error:</p>
  <p><a href="https://i.stack.imgur.com/840VU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/840VU.png" alt="error" /></a></p>
  <p>It says : dbo user, group, or rule already exists in the current database.</p>
  <p>Do you know how to correct this?
  thank you.</p>
  <p>EDIT:
  I tried this :</p>
  <pre><code>use HL7;
  exec sp_change_users_login 'Auto_Fix','dbo';
  </code></pre>
  <p>and I get this result:</p>
  <blockquote>
  <p>Abandon de cette procédure. 'dbo' est une valeur interdite pour le nom
  d'ouverture de session dans cette procédure.</p>
  </blockquote>
  <p>it means:</p>
  <blockquote>
  <p>Procedure aborted. 'dbo' is not allowed as session opening name in this statement.</p>
  </blockquote>