Андреа, тебе нужно быть более дисциплинированным.Вы несете ответственность за предоставление DDL и выборки данных.
SQL
-- DDL and sample data population, start
DECLARE @tbl TABLE (ID INT IDENTITY(1,1) PRIMARY KEY, Details XML);
INSERT INTO @tbl (Details)
VALUES
(N'<details schemaVersion="1">
<dataWarning>
<Locations>
<Failed_to_Create LocationID="1234">Location<Location_Description>TEST</Location_Description><FacilityID>TEST</FacilityID><Active>Y</Active></Failed_to_Create>
</Locations>
</dataWarning>
</details>')
, (N'<details schemaVersion="1">
<dataWarning>
<Locations>
<Failed_to_Create LocationID="5678">Location<Location_Description>Real Description</Location_Description><FacilityID>770</FacilityID><Active>N</Active></Failed_to_Create>
</Locations>
</dataWarning>
</details>');
-- DDL and sample data population, end
SELECT c.value('@LocationID', 'VARCHAR(10)') AS [locationID]
, c.value('(Location_Description/text())[1]', 'VARCHAR(100)') AS [Location_Description]
, c.value('(FacilityID/text())[1]', 'VARCHAR(100)') AS [FacilityID]
, c.value('(Active/text())[1]', 'VARCHAR(100)') AS [Active]
FROM @tbl AS tbl
CROSS APPLY tbl.Details.nodes('/details/dataWarning/Locations/Failed_to_Create') AS t(c);
Вывод
+------------+----------------------+------------+--------+
| locationID | Location_Description | FacilityID | Active |
+------------+----------------------+------------+--------+
| 1234 | TEST | TEST | Y |
| 5678 | Real Description | 770 | N |
+------------+----------------------+------------+--------+