Attach Database: specify database owner

  • HI. I'm puzzled by the attach database step where you specify database owner. I just recently took a database which, when you did a VIEW on its' properties, showed  owner:  servername\myname , but when I listed the USERS to this database, it showed DBO as SA.(Should they have not been one in the same?)  So then I did a detach and attach and specified the db owner to be a NEWNAME. When I did a refresh on the db and viewed the properties, the Owner had not changed, nor did the DBO listed inthe users. So my question is where does the specification of the database owner come into play on the ATTACH of the database. It is almost as if it complete ignores what name you select as db owner. 

    Confused...

    Juanita

     

  • after the attatch you'll have to use this :

    use yourdb

    exec sp_changedbowner @loginame = 'sa' ,@map = 'true'

    Also keep in mind EM does not refresh db-owner info ! You'll have to disconnect and connect to get the newest info.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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