i wnat to write a stored procedure to separate 2 columns using delimiters,

Last post 07-05-2009 1:13 AM by ajitha08. 2 replies.
Page 1 of 1 (3 items)
Active Topics My Discussions Unanswered Sort Posts: Previous Next
  • 07-04-2009 12:31 AM

    i wnat to write a stored procedure to separate 2 columns using delimiters,

    hi,

     I  wrote the sp. but im getting the error as

    Msg 9411, Level 16, State 1, Procedure sp_delimiterexample1, Line 5

    XML parsing: line 1, character 43, semicolon expected.

     

    here is my stored procedue..

     

    alter proc [dbo].[sp_delimiterexample1]

    @level_id varchar(50),

    @grp_id varchar(50)

    as

    SELECT F1.video_title, F1.video_drills, O.splitvideo

    FROM

    (

    SELECT *,

    cast('<x>'+replace(F.video_drills,',','</x><x>')+'</x>' as XML) as xmlfilter from tns_course_mst F )F1

    CROSS APPLY

    (

    SELECT video_drills.D.value('.','varchar(max)') as splitvideo

    FROM f1.xmlfilter.nodes('x') as video_drills(D)) O where level_id=@level_id and grp_id=@grp_id

     

     an anyone say where ui went wrong. 

     

  • 07-05-2009 12:09 AM In reply to

    Re: i wnat to write a stored procedure to separate 2 columns using delimiters,

    Welcome to the forum...

    I belive your data has the & in it...I believe it is illegal character in XML...

    So you need to hadle it by putting the hole string in CDATA...

     

    MohammedU.
    Microsoft SQL Server MVP
    Moderator
    SQL-Server-Performance.com

    All postings are provided “AS IS” with no warranties for accuracy.
  • 07-05-2009 1:13 AM In reply to

    Re: i wnat to write a stored procedure to separate 2 columns using delimiters,

     

    hi.........

     

     thank you so much for your quick reply...........but i have written the stored procedure by calling functions. i will check with your reply also....

     

     

Page 1 of 1 (3 items)
Active Topics   My Discussions    Unanswered Posts


© 2010 Jude O'Kelly All Rights Reserved.