The following oneliner can be used to change ALL of the table owners to dbo or any other user you choose. It uses an undocumented Microsoft SQL stored procedure and as such may not work on all version of MS SQL Server or other databases based on T-SQL.
1
2
|
--Change owner to dbo for ALL tables in DB
sp_MSforeachtable @command1="sp_changeobjectowner '?', 'dbo'"
|