jueves, 28 de febrero de 2008

How to use OPENXML in Transact-SQL


DECLARE @idoc int;
DECLARE @xml varchar(max);

EXEC sp_xml_preparedocument @idoc OUTPUT, @xml;
SELECT afield FROM OPENXML(@idoc, '/anodename/.../anodename[@anattribute="..."]/.../anodename[@anattribute="..."]', 1) WITH (afield int);
EXEC sp_xml_removedocument @idoc;

No hay comentarios: