Procedure to add back User Mapping

  • Following the restore of a database the User Mapping details have been deleted from Logins. The user still exists and has the correct authority on the database itself. The Login for the user still exists but the authority for the database I have restored has been removed from User Mappings in Logins. Is there a procedure that I can use, similar to the sp_change_users_login, that I can store and run from the master database, passing in the name of the database for which I want to add the authority? I want to run the procedure from a script.

  • Hi,

    If a login account is mapped to a 'database' user account then it in turn means that you are giving authority to that login to access the database. I think you can achieve what you want by passing in the 'database user' account instead of the database name to the sp_change_users_login sp from your script.

    Please correct me if I have not understood the requirement clearly.

    Regards,

    Prakash.

    ---------------------------------------------------------------------------------

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply