We've got a lot of objects in one database that are owned by another user then dbo.
I need to know all objects that this owner owns, if i can change them to dbo without any impact in the environment and how can i change all of them to be owned by dbo.
I've tried to replicate this environment in a test instance and i use the following query to get the following information, the point is that i can't change the schema/owner of this table and pk to dbo
select a.name, a.xtype, a.type, c.name as 'Schema Name'
from sysobjects a, sysusers b, sys.schemas c
where a.name like '%TblOwner%' and b.uid = c.principal_id and c.name like '%Tbl%'
Object Name Xtype Type Schema Name
TblOwnerName U U tblownerexample
pk_TblOwnerName PK K tblownerexample
Can you send me the sintax to get all this information?
Thanks and regards,