Problem: How to move, copy or
load flat files from different folders into SQL Server database tables using
SSIS?
Some files shared
via external resources gets saved on daily basis to a remote disk or shared
disk. To copy or get these files from different directories and archive the
file we can use File System Task of SSIS to accomplish this process.
File System task
performs operations on files and directories in the file system, create, move
or delete directories and files. All File System task operations use a source,
which can be a file or a directory.
The operations that
copy and move file and directories and rename files use a destination and a
source. The destination is specified by using a File connection manager or a
variable. File system task operations can be configured to permit overwriting
of destination files and directories. The operation that creates a new
directory can be configured to use an existing directory that has the specified
name instead of failing when the directory already exists.
Example:
In the example, I would like to show we can move files from
one location to other location.
Step 1: From the tool box drag File System task.
Step 2: Create destination connection and source connection
in the properties of the file system task and choose the file from source
folder to move the file.
from the drop down use create file to select in the destination.
Output:
As you can see the file has been moved from the source
directory to destination directory.
0 comments:
Post a Comment