Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OpenXML
Message
From
07/09/2002 12:18:31
 
 
To
06/09/2002 22:28:16
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
Miscellaneous
Thread ID:
00697354
Message ID:
00697920
Views:
15
>> I followed those basic steps and couldn't seem to select the data I wanted out of the XML.

Given the following XML fragment ...







You can use OPENXML to parse it like this:

DECLARE @hDoc int, @xml nvarchar(4000)

SELECT @xml = ...

EXECUTE sp_xml_preparedocument @hDoc OUTPUT, @xml

SELECT employee_name
FROM OPENXML(@hDoc, '/employees/employee/')
WITH (employee_name nvarchar(30) '@name')

EXECUTE sp_xml_removedocument @hDoc

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform