SQL Server Performance Forum – Threads Archive
Change table ownerHi, I want to change the table owner to another user, does anyone know how to make it? For example, change [a].[testing] to .[testing], but I want to change all user tables by batch. Can anyone help? Thanks!
Hi User SP_CHANGEOBJECTOWNER Table_Name,New Owner
The command can be performed in current database only. Please take care that the new user have access to database. You can automate the script by using DatabaseName..SP_CHANGEOBJECTOWNER ‘TableOwner.TableName’, NewOwner and make a batch file. HTH