Error Log error log

Published on November 24th, 2014 | by Alejandro Cordero


SQL Server 2014 Orphaned User

Error Message:

Msg 229, Level 14, State 1
%s permission denied on object %.*s, database %.*s, owner %.*s


Microsoft SQL-DMO (ODBC SQLState: 42000) Error 15023: User or role ‘%s’ already exists in the current database.


You might have an orphaned user. This means your login and database user are not matching properly, this happens usually after a SQL Server migration, database restore or certain maintenance tasks.


1- Run a report and make sure if in fact you have an orphaned user

USE adventureWorks


sp_change_users_login @Action='Report'


2-Re-map your user and login with the code below

USE AdventureWorks GO
exec sp_change_users_login @Action='update_one',  @UserNamePattern='TestUser1',  @LoginName='TestUser1'

MSDN Reference:

These are quick references by SQLTurbo, intended for quick review of commands
and quick solutions to common sql errors. This section does not elaborate
on topics deeply. However feel free to comment and we will try to make
suggestions as needed.


Also expect to read topics about  sql 2014 , sql tools , tsql tuning , sql performance tuning , sql monitor and more! Also coming soon, our SQL Server online training!

Tags: ,

About the Author

SQL Server DBA with over 8 years of experience, developer for .Net , Certified Scrum Master and Entrepreneur.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Back to Top ↑
  • Sign Up For Our Newsletter

    Stay up to date on the latest from SQL Server products and Features.

    Sign Up Now

    Sign up for mailing list and receive new posts directly to your inbox.

    We promise never to share or sell any of your personal information.

  • Recent Posts

  • Categories

  • Archives

  • Tags

  • Topics

  • Subscribe to our RSS Feed A SQL Server Web Blog
    Canada, Ontario, Ottawa.

    The Authors