Change the owner of tables and store procedures in SQL Server

Root Folder > SQL Server
By default who over creates the table, store procedure or the View is the owner of the object. There are several scripts you can run to change the db back to dbo . There is one good thread you can refer to : In additional note there is a script you can run in query analyzer and it creates the query ( first go to menu / query / set : result in text ) and then copy and paste the result back to query analyzer and it simply changes all owners.

SELECT 'EXEC(''sp_changeobjectowner @objname = '''''+ ltrim( + '.' + ltrim( + '''''' + ', @newowner = dbo'')'
FROM sysobjects s, sysusers u
WHERE s.uid = u.uid AND <> 'dbo' AND xtype in ('V', 'P', 'U')AND not like 'INFORMATION%'
order by

Add Feedback