Sunday, March 11, 2012

Can import from xls but what about csv??

Below is the query I use to import from an xls file. What about importing
from a csv file. I change the name from ChallengeResponse.xls to
ChallengeResponse.csv but I get an error. Anyone know any tricks to this?
Select *
FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0', 'Data
Source=C:\cr\dataload\ChallengeResponse.xls;Extended Properties=Excel
8.0')...ChallengeResponse$
Thanks in advance,
Eric"Eric Lovelace" <EricLovelace@.discussions.microsoft.com> wrote in message
news:50366645-7708-4956-9C49-48C585236E06@.microsoft.com...
> Below is the query I use to import from an xls file. What about importing
> from a csv file. I change the name from ChallengeResponse.xls to
> ChallengeResponse.csv but I get an error. Anyone know any tricks to this?
> Select *
> FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0', 'Data
> Source=C:\cr\dataload\ChallengeResponse.xls;Extended Properties=Excel
> 8.0')...ChallengeResponse$
>
> Thanks in advance,
> Eric
I'm not sure about using OPENDATASOURCE for a CSV, but you can definitely
use bcp as well as DTS.
Rick Sawtell
MCT, MCSD, MCDBA|||You can use the OLEDB provider for JET, which provides support for ISAM
sources; however, you will need to specify the type by using the Extended
Properties=TEXT instead of EXCEL and then the file name as the original with
the .CSV extension.
Sincerely,
Anthony Thomas
"Rick Sawtell" <quickening@.msn.com> wrote in message
news:eXSJT6GCFHA.2460@.TK2MSFTNGP14.phx.gbl...
"Eric Lovelace" <EricLovelace@.discussions.microsoft.com> wrote in message
news:50366645-7708-4956-9C49-48C585236E06@.microsoft.com...
> Below is the query I use to import from an xls file. What about importing
> from a csv file. I change the name from ChallengeResponse.xls to
> ChallengeResponse.csv but I get an error. Anyone know any tricks to this?
> Select *
> FROM OPENDATASOURCE ('Microsoft.Jet.OLEDB.4.0', 'Data
> Source=C:\cr\dataload\ChallengeResponse.xls;Extended Properties=Excel
> 8.0')...ChallengeResponse$
>
> Thanks in advance,
> Eric
I'm not sure about using OPENDATASOURCE for a CSV, but you can definitely
use bcp as well as DTS.
Rick Sawtell
MCT, MCSD, MCDBA

No comments:

Post a Comment