I realize this is 2 years old, but if someone comes along looking for more information, I wanted to include this. Here is the SQL used to find orphaned replicas: select name --delete
from sde.sde_versions where name not in (
select v.name from sde.gdb_items g join
sde.sde_versions v
on g.objectid = Left(SubString(v.name, PatIndex('%[0-9.-]%', v.name), 10)
, PatIndex('%[^0-9.-]%', SubString(v.name, PatIndex('%[0-9.-]%', v.name), 10) + 'X')-1)
where g.type = '{4ED4A58E-621F-4043-95ED-850FBA45FCBC}') and name like 'SYNC%'; Change the select to Delete and it will remove the orphaned replicas.
... View more