将CSV数据导入数据集,然后导出到SQL Server [英] Importing CSV data to a Dataset, then exporting to a SQL Server

查看:108
本文介绍了将CSV数据导入数据集,然后导出到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我花太多时间之前,我想知道是否有可能或希望尝试我认为需要做的事情.欢迎提供更好的建议.

我有1到N个.csv文件-该数量取决于用户选择-我需要从文件夹中获取文件.我的理解是Jet4.0提供程序将很好地做到这一点,并区分文本字段和数字字段.由于一批中可能有重复的记录(那些愚蠢的用户),我计划使用Jet4.0将数据导入数据集,然后使用查询删除重复项.不知道该怎么做,但是我会解决的.然后,我将基于由日期和电表标识符组成的两字段主键对数据进行排序(这些电表读数每天通过电子邮件发送给我们).

信息经过适当处理后,我想使用SQL Server提供程序将其移动到办公室服务器上的SQL Server实例.那有可能吗?我可以使用一个提供程序来填充和操作数据集,然后使用另一个提供程序将其移动到其他地方吗?我在任何地方都没有看到任何示例,因此我一无所知,而且我不想浪费一个星期来尝试做无法完成的事情.

Before I waste too much time on this, I''d like to know whether it''s possible, or desirable to attempt what I think I need to do. Advice on a better way is most welcome.

I have 1 to N .csv files - the number depends on user selections - that I need to get from a folder. My understanding is that the Jet4.0 provider will do this nicely, and differentiate between text and numeric fields. Since there may be duplicate records in a batch (damn those stupid users), I plan to use Jet4.0 to import the data into a Dataset, then use a query to remove the duplicates. Not sure how to do that exactly, but I''ll figure it out. Then I''ll sort the data based on a two-field primary key consisting of the date and meter identifier (these are power meter readings emailed to us daily).

Once the information is suitably massaged, I then want to move it to a SQL Server instance on the office server using the SQL Server provider. Is that even possible? Can I use one provider to populate and manipulate the dataset, then use another to move it elsewhere? I haven''t seen any examples anywhere of this being done, so I have no clue, and I''d hate to waste a week trying to do what can''t be done.

Is there a smarter way to approach this problem?

推荐答案

是的,Roger,有一种更聪明的方法可以解决此问题.
您知道SSIS(Microsoft Business Intelligence Studio)吗?
如果您设置了SSIS?请让我知道版本.
我将为您提供完成这些任务的整个步骤.
Yeah, Roger , there is one smarter way to do this.
did you know about SSIS (Microsoft Business Intelligence Studio) ?
IF you have a set up of SSIS ? Please let me know the version .
I will give you whole step to do these task .


这篇关于将CSV数据导入数据集,然后导出到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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