I\'m trying to change the owner of a table:
sp_changeobjectowner \'OWNER.TABLENAME\', \'dbo\'
But when executing I get the error message:
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