importing a CSV file

importing a CSV file

am 22.11.2007 07:52:00 von darkwarmbreeze

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

Re: importing a CSV file

am 22.11.2007 23:46:47 von Erland Sommarskog

Frank (darkwarmbreeze@yahoo.com) writes:
> 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@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downlo ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books .mspx