Link to home
Start Free TrialLog in
Avatar of r_pat72
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><col2>49.035792</col2><col3>-122.338480</col3><col4>ADDRESS</col4></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.

ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial