14 เมษายน 2555 16:49
I had a problem on importing data from CSV file.
Since the data provider did not follow the rule on the formats of CSV that created rows with two different columns, let's say:
type 1 rows: 10 columns
type 2 rows: 15 columns
rather than put 14 "," on type 1 rows, they only put 9 and make the end of Column10 nothing. So can anybody help me on importing the data like this? I am on an urgent job so if there is anyone can give me a hand that will be really appreciated.
14 เมษายน 2555 18:28
There are multiple options....
You can use SSIS from SQL Server 2012 - it supports changing number of columns in flat files.
Important question is it really a csv file:
1. are the records of type 1 and type 2 should be loaded to the same table?
2. is there any parent-child relationship between these types.
If it is true you will probably have to write script task to parse your file.
14 เมษายน 2555 20:49ผู้ดูแล
2) Read everything as a single column and then split it later on in the process
3) Script Component as source: http://microsoft-ssis.blogspot.com/2011/02/script-component-as-source.html
15 เมษายน 2555 7:36
I just tried sql server 2012 and it looks cool thanks :)
15 เมษายน 2555 7:37
thanks a lot
it really helps