dbTalk Databases Forums  

importing a CSV file

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss importing a CSV file in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frank
 
Posts: n/a

Default importing a CSV file - 11-22-2007 , 12:52 AM







I have a CSV file that i need to import into a SQL table. The problem
is the values in the first column are not brackited in "". There are
over 700K rows. Is there an easy way to fix the data or have SQL
correctly import the the data?

The data looks like this

1, "xxx","zzz"
2, "aaa","bbb"
an so on...

Thanks

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: importing a CSV file - 11-22-2007 , 04:46 PM






Frank (darkwarmbreeze (AT) yahoo (DOT) com) writes:
Quote:
I have a CSV file that i need to import into a SQL table. The problem
is the values in the first column are not brackited in "". There are
over 700K rows. Is there an easy way to fix the data or have SQL
correctly import the the data?

The data looks like this

1, "xxx","zzz"
2, "aaa","bbb"
an so on...
Which version of SQL Server? Which import tool do you want to use? I could
give the answer for BCP, but if that is not what you are using, it would
not help you...


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.