[英]What is the best practice for parsing data got from a web service?
I have got a web service (*.amsx) that I should call it within a SSIS package by service component. 我有一个Web服务(* .amsx),应该在SSIS包中按服务组件将其称为。
The web service returns some records and my mission is parsing every single record and do an appropriate action by looking at one of its fields (Action). 该Web服务返回一些记录,我的任务是解析每条记录,并通过查看其一个字段(动作)来执行适当的操作。 So If it contains value 'add' I should insert that record into my Database and if it contains 'edit', I should update its contents in my Database.
因此,如果它包含值“ add”,我应该将该记录插入到我的数据库中,如果它包含“ edit”,则应该更新它在数据库中的内容。
Now, my question is : Is there any best practice for such these scenarios when parsing data? 现在,我的问题是:解析数据时是否有针对此类情况的最佳实践?
In SSIS, do a dataflow where you get records from your source as the first part of the dataflow. 在SSIS中,执行数据流,从源中获取记录作为数据流的第一部分。 Next(within the same dataflow), do a condition split based on the value of the Action column you were referring to - this will parse your data into two separate flows - update, add/insert.
接下来(在同一数据流中),根据您要引用的Action列的值进行条件拆分-这会将您的数据解析为两个单独的流-更新,添加/插入。
For records that are to be inserted, do an oledb destination. 对于要插入的记录,请执行oledb目标。
For records that are to be updated, do an oledb command. 对于要更新的记录,请执行oledb命令。
All that should take place within a single dataflow. 所有这些都应在单个数据流中进行。 I would recommend including a check for the existence of the 'add' records (by key) in the destination before you insert so you don't get duplicates - that is if you would ever be running this package more than once.
我建议您在插入之前检查目标中是否存在“添加”记录(按键),这样就不会出现重复-也就是说,如果您将多次运行此程序包。
Anyway, that's the general idea. 无论如何,这是一般的想法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.