An update exists when SSIS processes import data, no existing inserts

Source: Internet
Author: User
Tags microsoft sql server microsoft sql server 2005 prepare ssis

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.