
with temp as
( select a.ID,a.BINDID, charindex('-',a.BINDID) as start, charindex('-',a.BINDID)-1 as lenth
from BO_EU_AAAA a
union all
select b.ID,b.BINDID,charindex('-',b.BINDID,start+1), charindex('-',b.BINDID,start+1)-start-1 as lenth
from temp b
where start<>0
)
select top(100) percent substring(BINDID,start -lenth,lenth) as obj, ID,BINDID
from temp
where (start <> 0)
order by BINDID
------你将BINDID换成你的PART,BO_EU_AAAA换成你的库