SSIS: problem with column mapping .csv and database table

Posted on 2012-09-14
Last Modified: 2012-12-21

I've a CSV file. For e.g, it contains three columns (RollNo, Name, Address).

I opened SSIS design and took data flow task --> Flat File Source + OLE DB Destination and mapped CSV file columns with database. Then run the package, it runs successfully.

After that, I open CSV file again and move column position like Name from 2nd position to Address and Address 3rd position to Name position. Of course, along with data as well.

Now, if I run again package then package runs successfully. But, column Address data goes to Name column and Name column data goes to Address column in database.

But if it is the case then why we need mapping while design?

Could you please look into it on urgent basis because for a requirement of a project; columns can be placed anywhere?

Best Regards,
Mohit Pandit
Question by:MohitPandit
    LVL 25

    Accepted Solution

    You have moved the data in the csv file with the column name and hoping that you mapped the column while designing the package, it should take care of that right. But it doesn't work like that. You have to remap it in the package because though what you see is a label, the mapping happens as column2, column3 wise. So, it won't consider if you just modify it in csv file.
    LVL 9

    Assisted Solution

    LVL 21

    Assisted Solution

    by:Alpesh Patel
    You have to remap or just open that flat file source and update.
    LVL 5

    Author Closing Comment


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now