stored procedure to split and loop

Posted on 2011-10-04
Last Modified: 2012-05-12
I need help in writing logic in stored procedure, to inser into TABLEA.
in the SQL stored procedure,
i have string ( that is @FeildInfo ) with

value1|Value2#value3|Value4#value5|value6 etc....

i want to split the above string ( @feildInfo) into  indivual values so that i can insert into table like,

valu1 should go to colum 'n' in the TABLEA
value2 should go to column 'P' in TABLEA

as one record.

value3 should go to column 'n' in the TABLEA,
value4 should go ro column 'p' in the TABELA

basically, i need to do
please help on this
i am using SQLSERVER2008

Question by:ram27
    1 Comment
    LVL 23

    Accepted Solution

    Please check the following Solution.  I believe you can leverage the function provided.

    SQL Parse string

    I hope it helps.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    Viewers will learn how the fundamental information of how to create a table.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now