Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Location
    Cergy
    Posts
    65

    Question Unanswered: Changing owner on a SQLServer DB ?

    We have received a DB from one of our customer.
    We want to change the DB and tables (and all objects) owner to sa
    How can we do that ?

    Thanks

  2. #2
    Join Date
    Feb 2004
    Posts
    492
    You could use the procedures 'sp_changedbowner' and 'sp_changeobjectowner' to change the owner for the database and objects (tables, views, etc) resp.

  3. #3
    Join Date
    Jan 2004
    Location
    Cergy
    Posts
    65

    Question Question

    can I do that in 1 commands for all tables (I have more 100 tables !!!) ?

  4. #4
    Join Date
    Feb 2004
    Posts
    492
    As far as I know there is no standard procedure that changes the owner of all objects to another.
    Last edited by Kaiowas; 09-03-04 at 10:50.

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Databases are owned by a SQL Server login. Objects within the database are owned by a database user. I strongly suspect that when you change the database owner login to sa, all of the objects are probably owned by dbo so they will appear as though they are owned by the sa login.

    -PatP

Posting Permissions

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