2

We need a tool that can convert a given well-defined SQL query into it's constituent xml form. Can anyone suggest anything of this sort, a free tool would do great help. Also, can you advise whether FetchXML by MS can be used to achieve this?

We can consider this trivial example to illustrate the requirement... Input:

select emp_name, emp_id from employee_table where emp_sal > 5000

Output:

<query>
    <entity name=”employee_table”>
        <attribute name=”emp_name” />
        <attribute name=”emp_id”/>
        <filter>
          <condition attribute=”emp_sal” operator =”&gt;” value=”5000”/>
        </filter>
    </entity>
</query>
Caleb Bell
  • 520
  • 6
  • 23
leonidas
  • 21
  • 1
  • 3
  • do you have a good definition of the 'constituent xml form'? – Randy Jun 13 '12 at 12:59
  • 1
    As for your first question, Stack Overflow isn't really the place to get recommendations or lists of things. As for your second question, please give an example of a SQL query and what you expect the "constituent xml form" to look like. – saluce Jun 13 '12 at 18:45

2 Answers2

4

We have recently launched a free online converter which can be used to convert SQL script to CRM FetchXML. The converter is available at http://www.sql2fetchxml.com/. Check it out and let me know if you have any questions about the converter.

Daniel Cai
  • 446
  • 2
  • 7
  • If you can post your query, I can have a look. It could just be a limitation of FetchXML query. Sorry for the late response, I don't typically monitor my SO account here. – Daniel Cai Nov 03 '14 at 20:15
0

Read this: SQL to fetch xml...how to ??

bluevector
  • 3,485
  • 1
  • 15
  • 18
  • @saluce We can consider this trivial example to illustrate the requirement. Input: select emp_name, emp_id from employee_table where emp_sal > 5000 – leonidas Jun 14 '12 at 06:11
  • Output: ” value=”5000”/> – leonidas Jun 14 '12 at 06:12
  • If that [post](http://social.microsoft.com/Forums/en/crmdevelopment/thread/92acf2d2-57e3-43af-a283-79ded0dd55c7) doesn't work for you, you're going to have to write a SQL parser -> Fetch XML generator. Basically, you're going to write a compiler. – bluevector Jun 14 '12 at 12:21