Consider the following:
DECLARE @docHandle int;
DECLARE @xmlDocument xml
set @xmldocument = N'
<property key="title">Showing Your Home that is for Sale - Home Selling Tips </property>
<html> This Is Your Marketing Page</html>
EXEC sp_xml_preparedocument @docHandle OUTPUT, @xmlDocument;
SELECT * FROM OPENXML(@docHandle, N'/pages/page', 2)
WITH (page_id varchar(1000), content varchar(max), title varchar(1000) 'properties/property/@key');
So ... this all works 'as expected', but is not what I need. Rather than having the last field
title populated with the value 'title', what I actually need returned is the value 'Showing Your Home that is for Sale - Home Selling Tips' instead. How do I write my column definition to accomplish that? If I have to do it as a separate query that's fine, as long as I have
title returned in the other query.
I should also say there will other property records, but one and only one where key = 'title'
I've spent way too long on this, your help is greatly appreciated!
- This topic was modified 1 week, 6 days ago by bvaljalo-1000038. Reason: clarification