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 ...
-
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
---------------------------------------------------------
-
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
>
> ---------------------------------------------------------
-
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
>> ---------------------------------------------------------
>>
Similar Threads
-
By Application Development in forum Java
Replies: 3
Last Post: 03-15-2007, 07:30 AM
-
By Application Development in forum XML SOAP
Replies: 4
Last Post: 08-29-2006, 07:48 PM
-
By Application Development in forum XML SOAP
Replies: 2
Last Post: 01-31-2006, 05:07 PM
-
By Application Development in forum XML SOAP
Replies: 1
Last Post: 04-21-2005, 11:48 PM
-
By Application Development in forum XML SOAP
Replies: 7
Last Post: 03-26-2005, 01:44 PM