Welcome to 2PTTechnology Sign in | Join
in Search

User or role already exists in the current database (Microsoft SQL Server, Error: 15023)

Last post 01-13-2008, 12:57 PM by pskobel. 3 replies.
Sort Posts: Previous Next
  •  01-25-2007, 2:29 PM 9

    User or role already exists in the current database (Microsoft SQL Server, Error: 15023)

    I’ve restored my database from a different server and all the users in security are set up but when I try to assign the user to that database I get an error that "its already assigned".  When I check the properties for that user and check the User Mapping, my database is unchecked.

    Does anyone know how to drop the user or reattach it? Because when I try, it keeps giving me an error "Drop Failed" or

    "Create Failed for User 'MyUser'. (Microsoft.SqlServer.Smo)" "User or role 'MyUser' already exists in the current database" error 15023

     

    Thanks

     

  •  01-25-2007, 2:47 PM 11 in reply to 9

    Re: User or role already exists in the current database (Microsoft SQL Server, Error: 15023)

    To fix this problem you need access to SQL Query Analyzer or any application that allows you to run SQL scripts.  Follow the steps below to fix you database problem.

    1) Login in SQL as administrator

    2) Set your database to Master

    3)  Run this script (replace YourDatabase and MyUser with the correct information)

    sp_configure "allow updates", 1

    go

    reconfigure with override

    go

    update YourDatabase..sysusers set sid = (select sid from master..syslogins where name = 'MyUser' ) where name = 'MyUser'

    go

    sp_configure "allow updates", 0

    go

    reconfigure with override

    go

     

  •  12-20-2007, 11:16 PM 95 in reply to 11

    Re: User or role already exists in the current database (Microsoft SQL Server, Error: 15023)

    In SQL 2005 I get this Msg when i run this script

    Msg 259, Level 16, State 1, Line 2

    Ad hoc updates to system catalogs are not allowed.

    Apparently direct updates to the system tables are not allowed. any ideas?

  •  01-13-2008, 12:57 PM 114 in reply to 95

    Re: User or role already exists in the current database (Microsoft SQL Server, Error: 15023)

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems