Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2003
    Posts
    62

    Unanswered: Restore problems.

    Hi,

    I need to restore a database from a server to another, but all tables are not dbo's tables.

    I first create the user on the destination instance, and after restoring datas, I try to change rights for this user.

    I can't delete or create new rights for this user because it own tables.

    How can I restore my users rights database ?

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    If you don't mind to change the owner to DBO (which is how it should have been) you can use sp_changeobjectowner procedure, without having to create the user.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    At this point, I'd probably use sp_change_users_login.

    -PatP

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    sp_change_users_login will map SID's, but will not allow to do what the poster asked for.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    At least as I read the question, the poster created a login named "foo" because there was a user in the database they were restoring that was already named "foo". If that is the case, and they were expecting their login to have access to the database, then sp_change_users_login would fix the SID values, giving the "foo" login on this server equivalent permissions in this database to what the "foo" login on the original server had.

    Once the poster fixes the underlying SID problem, they can then grant or revoke user permissions as they see fit.

    Do you think that I missed something?

    -PatP

  6. #6
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    As I said earlier, if you use sp_changeobjectowner, you don't even need to create the "foo" login to begin with.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  7. #7
    Join Date
    Aug 2003
    Posts
    62
    Thanks for all opf us.
    I succeed in my problem with sp_changeobjectowner procedure.

  8. #8
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    RDJabarov is the man

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •