【发布时间】:2016-06-15 01:52:09
【问题描述】:
我有以下 FetchXML 查询,用于在 Business Intelligent Development Studio 中创建报告。
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="incident">
<attribute name="ticketnumber" />
<attribute name="createdon" />
<attribute name="statuscode" />
<attribute name="incidentid" />
<attribute name="caseorigincode" />
<attribute name="new_statussla" />
<attribute name="ownerid" />
<attribute name="new_caseaging" />
<attribute name="casetypecode" />
<order attribute="ticketnumber" descending="false" />
<filter type="and">
<condition attribute="createdon" operator="on-or-after" value="@Startdate" />
<condition attribute="createdon" operator="on-or-before" value="@Enddate" />
<condition attribute="caseorigincode" operator="ne" value="3" />
</filter>
<link-entity name="systemuser" from="systemuserid" to="owninguser" visible="false" link-type="outer" alias="a_cf39b8fda77b421483a1af5e511c39ca">
<attribute name="new_region" />
<attribute name="businessunitid" />
</link-entity>
</entity>
</fetch>
我确实将此查询转换为 SQL 查询,如下所示。
SELECT a.ticketnumber, a.createdon, a.statuscode,
a.incidentid, a.caseorigincode, a.new_statussla,
a.ownerid, a.new_caseaging, a.casetypecode,
b.new_region, b.businessunitid
FROM FilteredIncident a, FilteredSystemUser b
WHERE a.ownerid = b.systemuserid
AND createdon >= @StartDate
AND creaedon <= @EndDate
AND caseorigincode != '3'
我的问题,我的 SQL 查询是否正确?虽然我可以执行。
【问题讨论】:
-
先生。 Shaa 没有将 xml 转换为 sql 的工具,您手动执行此操作,您将在其中制作解析器 ...
-
你可以试试这个,fetchxml2sql.codeplex.com 或者你可以从 SQL Profiler 中提取它...
-
旁注:请避免使用旧式连接。显式连接成为 ansi-sql 的一部分已有 20 多年了。欲了解更多信息,read this
-
好的,谢谢,@ZoharPeled 先生,你能用上面的查询给我看这个例子吗?可以联系我shaaruddin.daud@mason.com.my。
-
我没有回答你的问题。如果我有,我会把它贴在这里,而不是给你写一封电子邮件。
标签: sql-server reporting-services dynamics-crm fetchxml