How to split a string so that can access item x?

Answer

U can use this simple logic -

Declare@products varchar(200)='1|20|3|343|44|6|8765'Declare@individual varchar(20)=nullWHILE LEN(@products)>0BEGINIF PATINDEX('%|%',@products)>0BEGINSET@individual = SUBSTRING(@products,0, PATINDEX('%|%',@products))SELECT@individual

        SET@products = SUBSTRING(@products, LEN(@individual +'|')+1,
                                                     LEN(@products))ENDELSEBEGINSET@individual =@products
        SET@products =NULLSELECT@individual
    ENDEND

All windows Questions

Ask your interview questions on windows

Write Your comment or Questions if you want the answers on windows from windows Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---