Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OpenXML
Message
De
07/09/2002 12:18:31
 
 
À
06/09/2002 22:28:16
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Titre:
Divers
Thread ID:
00697354
Message ID:
00697920
Vues:
20
>> 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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform