Solved

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

Posted on 2014-02-09
4
1,540 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 500 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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

718 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