troubleshooting Question

strange results from openxml sql server 2005

Avatar of scm0sml
scm0sml asked on
Microsoft SQL Server 2005
8 Comments1 Solution382 ViewsLast Modified:
Hi,

I have the following sp.

Basically I am trying to pass in some xml and will then extract from this into a temp table but at the moment doing a simple select * from is bringing back results I don't understand, this is the first time I have used openxml so would be good if someone could explain and tell me what I am doing wrong.

The results are in an attached spreadsheet.

Thanks in advance. eg.xls
ALTER PROCEDURE dbo.SP_Get_685_Report
(
	@LINEIDXML TEXT
)

AS

DECLARE @idoc INT

EXEC sp_xml_preparedocument @idoc OUTPUT, @LINEIDXML

SELECT *
FROM OPENXML(@idoc, '/xml',1) 

EXEC sp_xml_removedocument @idoc

Open in new window

ASKER CERTIFIED SOLUTION
scm0sml

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros