I want to create a query builder which allows a user to build a query by selecting drop downs/text input etc on the web page which in turn creates an XML file containing the query filters such as (XML constructed from web page/View):
<Filters>
<Filter Table="MyTable" Column="Total" Value="1234" Predicate="0"></Filter>
</Filters>
The idea would be for a stored procedure to receive this XML markup and parse it somehow so that it would translate to something like
SELECT * FROM MyTable WHERE Total > 1234
I've found examples here that query XML or take XML in and then insert into tables but can anyone give me a simple example of how I would set the proc up to parse an XML parameter and build SQL?
I'm using C# (MVC) and SQL Server 2008.