How to change the user name from dbo

  • The user is one of the DB owners and currenly appears in the system as DBO. All the tables he creates any named as DBO.TABLE.

    He however wants to appear under his regular personal NT account name to create PERSONAL.TABLE and to have all existing objects to be renamed automatically.

    How can we do that?

  • sp_changeobjectowner or

    create table personal.tableA instead of create table tableA

  • Ooops, cross post?

    Didn't relazie that you've already answered, Steve.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • adding to Steve's solution.

    To avoid this, make this current user member of db_owners group and make an other user db owner (sp_changedbowner @loginame = 'yyy' ,@map = 'true'

    ). This way this user will still be able to manipulate all the db, and will have all objects he creates without schema-specification created as his_user_name.*** .

     

    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 4 posts - 1 through 3 (of 3 total)

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