请教:如何循环拆分字符串?
比如有:字符串“<abc>12345678<abc>ACDEF<abc>ABD456<abc>BCDGE<abc>fg456”,想以<abc>为界,拆分成5段:<abc>12345678<abc>ACDEF<abc>ABD456<abc>BCDGE<abc>fg456
declare @str varchar(500)set @str='<abc>12345678<abc>ACDEF<abc>ABD456<abc>BCDGE<abc>fg456'set @str=replace(@str,'<abc>',''' union all select ''<abc>')+''''set @str= right(@str,len(@str)-11)exec(@str)/*-------------<abc>12345678<abc>ACDEF<abc>ABD456<abc>BCDGE<abc>fg456