Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
IPFL
Starting Member
4 Posts |
Posted - 2014-01-07 : 09:34:05
|
Hello,I want to bulk insert a csv file into sql.If the csv files are all the same this is not so exiting but the csv file is a bit strange.If a row in the csv file begins with A than the row must be dropped.If a row in the csv file begins with B than the row content is10 chars for Product 20 chars for description 5 chars for quantityIf a row in the csv file begins with C than the row content is 5 chars for ordernr 5 chars for productid 5 chars for quantity...So CSV file could look like thisA 000 0 0 0 0B0000000001product description 00005C000020000300004...Now it's solved to split the csv file and import each record but this is to slow so it must be done via Bulk insert and format files?Any suggestions |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2014-01-07 : 22:14:51
|
i think you better off using SSIS (data flow component) to cater such event.http://technet.microsoft.com/en-us/library/ms137612(v=sql.105).aspx |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-01-08 : 06:58:17
|
I agree to waterduck. You've tasks available inside SSIS to do all these activities like Deruved Column, Conditional SPlit etc which will provide you with required functionality straight out of the box.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|