Click here to Skip to main content
16,018,158 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My string is as below :

SQL
<pre>'<SL1> Locationdetails are in the table .<RXCH><cF7712>Location1<cF4712>
            <RXCS1>H1<RXCS2>H2<RXCS3>H3
            <RXC11>C11<RXC12>C12
            <RXC13>C13<RXC21>C21
            <RXC22>C22<RXC23>C23
            <RXC31>C31<RXC32>C32
            <RXC33>C33<RXC41>C41
            <RXC42>C42<RXC43>C43
            <RXC51>C51<RXC52>C52
            <RXC53>C53
            <RXCH><cF7712>Location2<cF4712>
            <RXCS1>H1<RXCS2>H2<RXCS3>H3
            <RXC11>C11<RXC12>C12
            <RXC13>C13<RXC21>C21
            <RXC22>C22<RXC23>C23
            <RXC31>C31<RXC32>C32
            <RXC33>C33<RXC41>C41
            <RXC42>C42<RXC43>C43
            <RXC51>C51<RXC52>C52
            <RXC53>C53. Services for primary health care'


OUTPUT should be ::


SQL
'Location1 H1 H2 H3 C11 C12 C13 C21 C22 C23 C31 C32 C33 C41 C42 C43 C51 C52 C53 Location2 H1 H2 H3 C11 C12 C13 C21 C22 C23 C31 C32 C33 C41 C42 C43 C51 C52 C53'
Posted
Updated 24-Apr-14 23:32pm
v2

1 solution

refer this
http://www.codeproject.com/Questions/620183/Split-string-function-in-Sql-Server
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900