?
Solved

How to convert transfer data from cvs file to table using SSIS package?

Posted on 2014-02-09
4
Medium Priority
?
1,555 Views
Last Modified: 2016-02-10
I have csv file in my network shared folder so i need to transfer all those csv file to table in DB..

csv file

Data.csv

  Zone               Employee               EmpID        Date
 North       Alarcon, Vanessa             1425114      20140502
 North      Appelgren, Richard             1425144     20140502
 North      Appelgren, Richard             1425144     20140502
 North      Austin, Benjamin             1425042     20140502

Data(table in sql db)


When  i am reading from csv file i am unable to read full name of employee column from csv file because employee full name was separated by a column.How can i fix this problem ??And date column in csv file is in different format how can i fix this and get in 2/5/2014 format.?
Can you please help me guys??
0
Comment
Question by:GreatLakes07
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Tony303 earned 2000 total points
ID: 39846308
OK,

Several Options...
Lets look at the Employee ccolumn first...
1. If the csv file has this data with "double quotes" at the start and end of the field then use the TEXT QUALIFIER as " in your Connection Manager connection for the csv.

2. If there is no "double quotes" then it is 2 columns and it would seem the EmpID would actually be the christian name. IE Vanessa, Richard and Benjamin.
If so, then you may have to do a concatenate later to bring the 2 values together.

Now the date column.
Add a data conversion task after the csv source and before the OLE DB destination task. Transform from the string provided in the csv and convert it to a date.

I hope this helps a bit.
T
0
 

Author Closing Comment

by:GreatLakes07
ID: 39846311
Exceptionally good.
0
 

Author Comment

by:GreatLakes07
ID: 39846314
Yes i fixed the problem but while converting to date format i am getting error :(
0
 
LVL 12

Expert Comment

by:Tony303
ID: 39846338
Hey,

Thanks for the points and comments. I appreciate it.
Have a wee look here for the date conversion thing in SSIS...

http://blogs.msdn.com/b/mattm/archive/2010/08/04/string-to-date-conversion.aspx

(I must admit, I generally pull all the csv stuff in to a load table, all raw, warts and all. Then I clean it up with a SQL statement so, for this I'd Convert the date in SQL rather than SSIS).

T
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

800 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