Rename objects from DBO.OBJECT to PERSONAL.OBJECT

  • 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?

  • Why?

    You might want to read this and decide then http://www.sqlservercentral.com/columnists/awarren/worstpracticesobjectsnotownedbydbo.asp

     

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

  • Sorry, hit the button too early.

    If you really want this, take a look at sp_changeobjectowner in BOL

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

  • Just a note on this: if the object is renamed to a user other than the DBO, there is the real posibility that the object will fail. In the case of a stored procedure, changing the ownership might cause the sp to fail because the new owner does not have the permission to do everything that is hapening in the sp.

Viewing 4 posts - 1 through 3 (of 3 total)

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