- 查看
a. 查看数据库的owner
select a.name, suser_sname(a.owner_sid) as oname from sys.databases a order by oname
b. 查看job的owner
select a.name, suser_sname(a.owner_sid) as oname from msdb..sysjobs a order by oname
c. 查看endpoint的owner
select a.name, a.principal_id,suser_sname(b.sid) from sys.endpoints a left join sys.database_principals b on a.principal_id=b.principal_id - 修改
a. 修改数据库对象的owner
ALTER AUTHORIZATION ON DATABASE::Archive To sa;
b. 修改endpoint对象的owner
ALTER AUTHORIZATION ON ENDPOINT::endpoint_mirroring To sa;