Running the below SQL/XPath query returns the following error:
Query:
;WITH XMLNAMESPACES (
'http://schemas.microsoft.com/win/2004/08/events/event' as ns
, default 'http://schemas.microsoft.com/win/2004/08/events/event'
)
select [Events].[Event].value('(./System/TimeCreated/@SystemTime)[1]','nvarchar(100)') EventTime
from @xml.nodes('/*/Event/') [Events]([Event])
Error:
XQuery [nodes()]: Syntax error near '<eof>', expected a step expression.
From: http://www.experts-exchange.com/Database/MS-SQL-Server/Q_27789732.html
The issue was the /
on the end of the xpath. i.e.
from @xml.nodes('/*/Event/') [Events]([Event])
Should have been:
from @xml.nodes('/*/Event') [Events]([Event])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With