Problem Description:
When you import data from other databases, or other data sources such as text files to the destination database, you sometimes want to be able to implement the "update when data is present, when it does not exist," in the process of importing.
In the past, it is common to import a temporary table and then judge processing to import the formal table, in SQL Server 2005, SSIS can complete this processing directly when importing processing.
Here's a concrete example of how to use SSIS to complete such a process :
1. Prepare test environment
--1. Create the following object in the database
Use tempdb
Go
CREATE TABLE DBO.TB (
ID int PRIMARY KEY,
Name nvarchar (128))
Go
--2. Prepare two text files, placed in the D:/test directory, the contents of the file are as follows
T1.txt
ID Name
1 sheets of three
2 Dick
T2.txt
ID Name
1 Zhang San June
3 Lilin
4 UAE
2. Create a new integration Services project (Create an SSIS package)
Ø in the Start menu, point to All Programs, click Microsoft SQL Server 2005, and then click SQL Server Business Intelligence Development Studio.
Ø on the File menu, point to New, and then click Project to create a new integration Services project.
Ø in the Templates pane of the New Project dialog box, select Integration Services Project.
Ø in the Name box, change the default name to SSIS Tutorial