SQL Server Performance

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

Discussion in 'SQL Server 2008 T-SQL Performance Tuning' started by ajitha08, Jul 3, 2009.

  1. ajitha08 New Member

    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.splitvideoFROM
    (
    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.
  2. MohammedU New Member

    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...
  3. ajitha08 New Member

    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....

Share This Page