r_pat72
asked on
problem in executing "sp_xml_preparedocument" stored procedure
Hello,
I am executing this below code in sql queryanalyzer .It returns the null value.
Here is my code
exec sp_xml_preparedocument @hDoc OUTPUT,'<Shops><Shop><col1 >01000200< /col1><col 2>49.03579 2</col2><c ol3>-122.3 38480</col 3><col4>AD DRESS</col 4></Shop>< /Shops>'
Select col1,col2,col3,col4
FROM OPENXML(@hDoc, 'Shops/shop')
WITH (col1 varchar(10),col2 varchar(50),col3 varchar(50),col4 varchar(50))
output
-----------------
col1 col2 col3 col4
-------------------------- -
null null null null
But it should return the value of col1,col2,col3,col4.
Could anyone help me for this.
I am executing this below code in sql queryanalyzer .It returns the null value.
Here is my code
exec sp_xml_preparedocument @hDoc OUTPUT,'<Shops><Shop><col1
Select col1,col2,col3,col4
FROM OPENXML(@hDoc, 'Shops/shop')
WITH (col1 varchar(10),col2 varchar(50),col3 varchar(50),col4 varchar(50))
output
-----------------
col1 col2 col3 col4
--------------------------
null null null null
But it should return the value of col1,col2,col3,col4.
Could anyone help me for this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.