I have this XML structure, which I have to parse into SQL Server and create a Where condition:
<Columns>
<Column name='Id' condition=' > ' value='20'>
<Column name='salary' condition=' < ' value= 20000>
</Columns>
Number of column nodes can vary 2,3,4 etc.
Output should be like:
Id > 20 and salary < 20000
For this I have to loop the column nodes and concatenate the attributes in single where string.
Using following article I'm able to read the XML: http://blog.sqlauthority.com/2009/02/13/sql-server-simple-example-of-reading-xml-file-using-t-sql/
My main challenge is to read the XML in efficient manner.