自动导入文件 [英] Automate Importing File

查看:88
本文介绍了自动导入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我需要自动将excel文件导入表格。这是我的

场景:我正在编写一个ASP.NET应用程序,用户可以在其中提取

导入数据的报告。导入的数据从旧的基于UNIX的系统中提取,然后转换为Excel。我希望用户能够使用Web应用程序选择并将文件上传到服务器,然后按一个按钮让

SQL服务器处理Excel文件并导入它。我知道我可以做到这一切

ASP.NET:打开excel文件并将记录追加到表中,但这不是最优惠的b $ b。 Excel文件每次都采用相同的格式,因此每个导入的列和

都是相同的。


你能给我一些反馈意见吗?链接到一些资源。


谢谢!


David Lozzi

解决方案

您可以编写一个DTS包来导入数据,然后通过DMO调用




基于过去的许多经验我不得不说Excel只是

选择数据交换的最差格式。特别是如果涉及用户的人工干预,则需要b $ b。格式化,未定义的数据类型以及电子表格格式暗示的缺乏验证

存在许多问题

。如果你有一个可以导入到Excel的Unix源

,那么这可能是一个更好的地方来为你的数据库提供数据。


-

David Portas

SQL Server MVP

-


在它到达Excel之前,它在制表符分隔的文本文件中。请问这是什么?
更开心?


另外,我该怎么写我需要的东西。我需要对导入的

开发有一点指导。任何参考资料?


-

David Lozzi

Web应用程序开发人员
dlozzi @(删除 - 这个)delphi-ts.com


" David Portas" < RE **************************** @ acm.org>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

您可以编写一个DTS包来导入数据,然后通过DMO调用它。

基于以往的许多经验,我不得不说Excel只是
选择数据交换的最差格式。尤其如此
如果涉及用户的人工干预。格式化,未定义的数据类型以及电子表格格式暗示的缺乏验证存在许多固有的问题。如果你有一个可以导入到Excel的Unix源,那么这可能是为你的数据库提供数据的更好的地方。

-
David Portas
SQL Server MVP
-



集成服务包作业(带任务)似乎是你的朋友

这里。


-

William Stacey [MVP]


" David Lozzi" < DL **** @ nospam.nospam>在消息中写道

新闻:Oj ************** @ TK2MSFTNGP12.phx.gbl ...

你好,
我需要自动将excel文件导入到表中。这是我的
场景:我正在编写一个ASP.NET应用程序,用户可以在其中提取导入数据的报告。导入的数据从旧的基于UNIX的系统中提取,然后转换为Excel。我希望用户能够使用web
应用程序选择文件并将其上传到服务器,然后按一个按钮让SQL服务器处理Excel文件并导入它。我知道我可以在ASP.NET中完成这一切:打开excel文件并将记录追加到表中,但这不是最佳的。每次Excel文件都采用相同的格式
因此每个导入的列等都是相同的。

您能否向我提供一些反馈或链接到某些资源。

谢谢!

David Lozzi



Hello,

I need to automate importation of a excel file into a table. Here''s my
scenario: I''m writing an ASP.NET application where users can pull reports on
imported data. The imported data is pulled from an old UNIX based system,
then converted to Excel. I want the user to be able to use the web app to
select and upload the file to the server, then press a button to have the
SQL server process the Excel file and import it. I know I can do this all in
ASP.NET: open excel file and append records to the table, but this can''t be
optimal. The Excel file will be in the same format each time so columns and
such will be the same for each import.

Can you provide me some feedback or link to some resources.

Thanks!

David Lozzi

解决方案

You could write a DTS package to import the data and then invoke that
through DMO.

Based on many past experiences I have to say that Excel is just about
the worst possible format to choose for data interchange. Especially so
if manual intervention by users is involved. There are lots of problems
inherent in the formatting, undefined datatypes and lack of validation
that are implied by the spreadsheet format. If you have a Unix source
that you can import to Excel then that may well be a better place to
source the data for your database.

--
David Portas
SQL Server MVP
--


Before it reaches Excel its in a tab delimited text file. WOuld this be
happier?

Also, how do I write what I need. I need a little guidence on the
development of the import. Any references?

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com

"David Portas" <RE****************************@acm.org> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

You could write a DTS package to import the data and then invoke that
through DMO.

Based on many past experiences I have to say that Excel is just about
the worst possible format to choose for data interchange. Especially so
if manual intervention by users is involved. There are lots of problems
inherent in the formatting, undefined datatypes and lack of validation
that are implied by the spreadsheet format. If you have a Unix source
that you can import to Excel then that may well be a better place to
source the data for your database.

--
David Portas
SQL Server MVP
--



Integration services package job (with tasks) would seem to be your friend
here.

--
William Stacey [MVP]

"David Lozzi" <dl****@nospam.nospam> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...

Hello,

I need to automate importation of a excel file into a table. Here''s my
scenario: I''m writing an ASP.NET application where users can pull reports
on imported data. The imported data is pulled from an old UNIX based
system, then converted to Excel. I want the user to be able to use the web
app to select and upload the file to the server, then press a button to
have the SQL server process the Excel file and import it. I know I can do
this all in ASP.NET: open excel file and append records to the table, but
this can''t be optimal. The Excel file will be in the same format each time
so columns and such will be the same for each import.

Can you provide me some feedback or link to some resources.

Thanks!

David Lozzi



这篇关于自动导入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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