在 SSIS 中查询网站 [英] Query a website in SSIS
问题描述
有没有办法编写 SSIS 脚本以访问网站,在搜索字段中输入数据,然后返回结果?我正在尝试通过 SSIS 包获取邮政编码的纬度和经度.
Is there any way to script SSIS to reach out to a website, input data in a search field, and then return the results? I am trying to get the latitude and longitude of postal codes as it goes through the SSIS package.
这是我想使用的网站:http://www.gpsvisualizer.com/geocode
这甚至可能吗?或者更简单的方法来做到这一点?
Is this even possible? Or an easier way to do this?
是的,在有人问之前,我一整天都在寻找解决方案,但我什么也找不到.
And yes before anyone asks, I've been searching all day to find a solution for this and I can't come across anything.
谢谢.
推荐答案
您可以通过数据流本身中的脚本组件(无需制作适当的 DLL)来调用 API但要现实地看待它.
You can reach out and call the API via a script component (no need to make a proper DLL) in the Data Flow itself but look at it realistically.
您正在根据邮政编码执行纬度/经度查找.数量有限.它们不会改变--- 65401 的中心点总是 将评估为相同的值,所以为什么要多次从提供商处要求它.这些免费服务中的大多数都对您在一个时间范围内可以进行的调用数量设置了上限,因此与其进行实时查找,不如计算所有可能的值.花点时间收集它们,然后将它们存储在您的本地数据库中.顺便说一下,这可能会也可能不会违反网站的服务条款.
You're performing a Lat/long lookup based on postal codes. There is a finite number of those. They aren't going to change---the center point for 65401 is always going to evaluate to the same value so why ask for it multiple times from a provider. Most of these free services have an upper boundary on the number of calls you can make within a timeframe so instead of doing a realtime lookup, compute all the possible values. Take your time collecting them and then store them in your local database. This may or may not violate a site's ToS by the way.
在您的数据流本身中,添加一个查找组件,然后只需查询您在上面创建的表,然后它就会运行.
Within your Data Flow itself, add a Lookup Component and then simply query the table you created above and away it runs.
这篇关于在 SSIS 中查询网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!