将数据从Dynamics CRM加载到SQL Server [英] Loading Data from Dynamics CRM to SQL Server

查看:128
本文介绍了将数据从Dynamics CRM加载到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法使用Azure数据工厂从Dynamics CRM到SQL Server获取选项集字符串.

Not able to get optionset string from Dynamics CRM to SQL Server using Azure data factory.

我正在使用Azure数据工厂将数据从Dynamics CRM移至SQL DB.我使用fetchXML查询从源(CRM)获取数据.我可以正常获取字符串和guid类型值,而不会出现任何问题.

I am using Azure data factory to move data from Dynamics CRM to SQL DB. I used fetchXML query to get the data from source (CRM). I am able to get normal string and guid type values without any issue.

但是CRM的optionsset字段是Int32类型的(即,我得到的是optionset的值,而不是字符串).

But the optionset field from CRM is coming as Int32 type (ie, I am getting the value of optionset, not the string).

如何解决此问题?

推荐答案

可能您正在使用

Probably you are using this approach to get the fetchxml resultset as Dynamics source to dumping into SQL using Azure Data factory. The problem you are facing is unable to consume the formatted text value for that picklist option.

我们将使用以下语法在代码中使用格式化的值:

We will do consume the formatted value using below syntax in code: Reference

//Option set
var industrycodeValue = accountDetails['industrycode'];

var industrycodeTextValue = accountDetails['industrycode@OData.Community.Display.V1.FormattedValue'];

如果您无法执行此操作,则最好在SQL中转储另一个名为stringmap的表,该表将存储系统中的所有选择列表选项.

If you cannot do such thing, then it’s better to dump another table in your SQL called stringmap which will store all the picklist options across the system.

然后,您可以对两个表进行内部联接以获取必要的数据.

Then you can inner join both tables to get the necessary data.

select INC.TicketNumber[Case ID],SMT.Value[Status Name], SMT.AttributeValue[Status Value]
from incident as INC inner join StringMap as SMT
on INC.StatusCode = SMT.AttributeValue
where SMT.AttributeName='statuscode' and SMT.ObjectTypeCode=112

了解详情

这篇关于将数据从Dynamics CRM加载到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆