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.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 How to import a csv with >1024 cols?

Author  Topic 

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-06-24 : 05:37:53
Can anyone tell me how I can import a csv with more than 1024 columns please?

Thanks

Ifor
Aged Yak Warrior

700 Posts

Posted - 2010-06-24 : 06:11:56
You could:

1. Using a different column separator, import everything into one varchar(MAX) column and then processes it in SQL.
2. Use SSIS to process the source file as you import. (Never done this.)
3. Write a C#, or other language, program to process the source file as you import. (My preference.)
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-06-24 : 08:02:59
Thanks, but SSIS won't touch it (tried that already)
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-06-29 : 09:05:54
Is there a way of maybe reading out the first 500 columns and writing these to a table, then reading out the rest of the columns and writing those to another table?
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-29 : 09:55:56
I found this interesting:
https://community.altiusconsulting.com/blogs/altiustechblog/archive/2008/07/31/q-how-do-you-load-a-csv-file-with-4500-columns.aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-06-29 : 10:29:13
Thanks, I tried that this morning, seems to get the data imported wrongly, I'm still checking it out though as I think I may have made a mistake somewhere.
Go to Top of Page
   

- Advertisement -