Change ownership for User Defined Data Types

  • Hello,

     

    Does anybody know an easy way to change User Defined Data Types ownership to “dbo”, without dropping dependent objects?

     

    I know that there is a st. proc sp_changeobject owner, but it does not deal with this particular db objects. Is there a similar st.procedure or script that would do the same operation?

     

    Thank you

     

  • use ur_DB

    sp_configure 'Allow Update',1

    Reconfigure WITH OVERRIDE

    Update sysTypes

    Set uid = user_id('sa')   -- change "sa" with the new owner

    Where Name = 'TestType'

    --TestType is the name of the UDT

    sp_configure 'Allow Update',0

    Reconfigure WITH OVERRIDE

     

  • Thank you Li Zhi-song for your help. It did work and solved my problem.

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

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