Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Sql query to fetch xml query for temporary table

Posted on by Microsoft Employee

Hi All,

I am converting CRM 2013 reports to dynamics d365. As the SQL queries are not supported in d365 i need to write the fetch XML for it. One of the requirement is that : 

there is one data-set which shows the value of years i.e Jan 2016 to Dec 2050 which is data-set for one of the parameter for my report. They have got this data-set by writing SQL query by creating temporary table in which they are retrieving this months.

Now since i need to convert this SQL query to fetch XML can anyone help me or tell if it is possible to create fetch XML query for creating temporary table and writing the code as above for retrieving the months as those i cannot fetch from CRM.

I tried and searched but not found any links for it.

Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sql query to fetch xml query for temporary table

    I created an entity for that in CRM and fetched the values

    Thanks

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Sql query to fetch xml query for temporary table

    Hi partner,

    Unfortunately, fetchxml does not support temporary table or subquery.

    I suggest that you could change your logic and use "join" function in your sql code and fetchxml supports join function at the same time.

    Here is a tool about transferring sql to fetchxml.http://www.sql2fetchxml.com/

    Sorry that I didn't find other useful solutions for you.

    Hope it helps.

    Best Regards,

    Leo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans