XQuery returns some blank rows



I am a newbie to XQuery and although I've read up on this a little and followed some on-line examples I am struggling with why the following is happening.


This query is returning blank rows in the returned data that correspond with rows in the source data where the Action node is not set to Login.



SELECT ActionInformation.query('/Audit[Action="Login"]') AS [Action] FROM AuditHistory


It returns the same number of rows as the source table, some rows populated with the XML from the source but with some rows blank.


Question is why? Also, how do I stop it doing this so I only get the rows where the Action is Login?


Thanks, Kevin


No comments:

Post a Comment