I can’t tell you how many times I’ve done an import and ended up with the wrong database owner. Use this following script to change the owner on all tables in a database.
In the sql below, set the @oldowner and @newowner variables appropriately.
DECLARE @oldowner sysname, @newowner sysname, @sql varchar(1000)
SELECT
@oldowner = 'OLD_OWNER',
@newowner = 'dbo',
@sql = '
IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLES
WHERE
QUOTENAME(TABLE_SCHEMA)+''.''+QUOTENAME(TABLE_NAME) = ''?''
AND TABLE_SCHEMA = ''' + @oldowner + '''
)
EXECUTE sp_changeobjectowner ''?'', ''' + @newowner + ''''
EXECUTE sp_MSforeachtable @sql
(I found this somewhere on the internet some time ago but have lost it's reference.)