自动将许多.txt文件导入到SQL Server表中 [英] Auto Import many .txt files into sql server table

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

问题描述

我有很多 .txt 文件,我想将它们导入到SQL Server表中.

I have many .txt files and I want to import them into SQL Server table.

文件名类似于:

hazem.20160922.txt

hazem2.20160921.txt

该表已经存在,因此无需再次创建它.这是日常活动,因此我需要使其自动化.我在网上阅读了很多文章,但是我做不到.

The table exists already so no need to create it again. This is a daily activity, so I will need to automate that. I read many articles online and I am unable to do it.

推荐答案

由于您说这是每天都会发生的自动过程,因此您可以创建一个SSIS(ETL)作业来执行此操作,并且可以在以下位置安排该作业如此之遥,以至于每天都会运行.

Since you said it is an automatic process that should happen every day, you can create an SSIS (ETL) Job to do this and you can schedule the job in such a away that it will run everyday.

这是链接,该链接将清楚地说明如何创建一个ETL包作为平面文件源和数据库目标.

Here is the link that will clearly explain how to create an ETL package as Flat File source and Database Destination.

链接将帮助您逐步完成在SQL Server代理中计划作业的步骤.

This link will help you with step by step procedure for Scheduling a Job in SQL Server Agent.

您可以在Source中选择文件夹路径而不是文件名,以便ETL Job每天将一次将文件夹中的所有文件移动到目标表中.

You can select the folder path instead of file name in the Source so that ETL Job will move all the files in the folder to destination table once per day.

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

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