Help me with this SELECT FROM OPENXML - XML SOAP

This is a discussion on Help me with this SELECT FROM OPENXML - XML SOAP ; The following script doesnt return any records. Why ? --------------------------------------------------------- declare @t varchar(1000) DECLARE @XMLDocPointer1 INT EXEC sp_xml_preparedocument @XMLDocPointer1 OUTPUT, @t set @t = '<EMP><EE EID=''1'' NAME=''ANAND'' /><EE EID=''2'' NAME=''SAGAR'' /></EMP>' select @t BEGIN TRANSACTION select * FROM OPENXML(@XMLDocPointer1,'/EMP/EE') WITH ...

+ Reply to Thread
Results 1 to 3 of 3

Help me with this SELECT FROM OPENXML

  1. Default Help me with this SELECT FROM OPENXML

    The following script doesnt return any records. Why ?

    ---------------------------------------------------------
    declare @t varchar(1000)
    DECLARE @XMLDocPointer1 INT

    EXEC sp_xml_preparedocument @XMLDocPointer1 OUTPUT, @t

    set @t = '<EMP><EE EID=''1'' NAME=''ANAND'' /><EE EID=''2''
    NAME=''SAGAR'' /></EMP>'
    select @t
    BEGIN TRANSACTION
    select * FROM
    OPENXML(@XMLDocPointer1,'/EMP/EE')
    WITH (EID VARCHAR(2), ENAME VARCHAR(30))

    EXEC sp_xml_removedocument @XMLDocPointer1
    COMMIT

    ---------------------------------------------------------


  2. Default Re: Help me with this SELECT FROM OPENXML

    You must assign value to @t variable before sp_xml_preparedocument
    call.

    On Jul 16, 1:04 pm, Sagar <anandsa...> wrote:
    > The following script doesnt return any records. Why ?
    >
    > ---------------------------------------------------------
    > declare @t varchar(1000)
    > DECLARE @XMLDocPointer1 INT
    >
    > EXEC sp_xml_preparedocument @XMLDocPointer1 OUTPUT, @t
    >
    > set @t = '<EMP><EE EID=''1'' NAME=''ANAND'' /><EE EID=''2''
    > NAME=''SAGAR'' /></EMP>'
    > select @t
    > BEGIN TRANSACTION
    > select * FROM
    > OPENXML(@XMLDocPointer1,'/EMP/EE')
    > WITH (EID VARCHAR(2), ENAME VARCHAR(30))
    >
    > EXEC sp_xml_removedocument @XMLDocPointer1
    > COMMIT
    >
    > ---------------------------------------------------------




  3. Default Re: Help me with this SELECT FROM OPENXML

    Hello gapokrif,

    Well spotted


    Simon Sabin
    SQL Server MVP
    http://sqlblogcasts.com/blogs/simons


    > You must assign value to @t variable before sp_xml_preparedocument
    > call.
    >
    > On Jul 16, 1:04 pm, Sagar <anandsa...> wrote:
    >
    >> The following script doesnt return any records. Why ?
    >>
    >> ---------------------------------------------------------
    >> declare @t varchar(1000)
    >> DECLARE @XMLDocPointer1 INT
    >> EXEC sp_xml_preparedocument @XMLDocPointer1 OUTPUT, @t
    >>
    >> set @t = '<EMP><EE EID=''1'' NAME=''ANAND'' /><EE EID=''2''
    >> NAME=''SAGAR'' /></EMP>'
    >> select @t
    >> BEGIN TRANSACTION
    >> select * FROM
    >> OPENXML(@XMLDocPointer1,'/EMP/EE')
    >> WITH (EID VARCHAR(2), ENAME VARCHAR(30))
    >> EXEC sp_xml_removedocument @XMLDocPointer1
    >> COMMIT
    >> ---------------------------------------------------------
    >>




+ Reply to Thread

Similar Threads

  1. help me validating a form <select></select> with validator
    By Application Development in forum Java
    Replies: 3
    Last Post: 03-15-2007, 07:30 AM
  2. OPENXML
    By Application Development in forum XML SOAP
    Replies: 4
    Last Post: 08-29-2006, 07:48 PM
  3. OPENXML Namespace
    By Application Development in forum XML SOAP
    Replies: 2
    Last Post: 01-31-2006, 05:07 PM
  4. openxml - C# example please!
    By Application Development in forum XML SOAP
    Replies: 1
    Last Post: 04-21-2005, 11:48 PM
  5. OPENXML
    By Application Development in forum XML SOAP
    Replies: 7
    Last Post: 03-26-2005, 01:44 PM