Changing a table owner

前端 未结 5 1257
名媛妹妹
名媛妹妹 2021-02-04 00:21

I\'m trying to change the owner of a table:

sp_changeobjectowner \'OWNER.TABLENAME\', \'dbo\'

But when executing I get the error message:

5条回答
  •  梦如初夏
    2021-02-04 01:20

    SELECT 'Exec sp_changeobjectowner ''.' + name + ''',  ''dbo''  '  FROM sys.objects WHERE type IN ('U','P','V','FN')
    

    Apply Following Steps

    (1) Run Following Query on Sql Prompt (2) Copy The Result and Paste Again to New Sql Query and Again Execute

    This is Change owner of your Tables, Views, Stored Procedures and Functions

提交回复
热议问题