jrollins138
asked on
How do I change the delimiter used by OPENROWSET when reading a text file?
Hi folks,
I am using OPENROWSET to read a delimited text file created by another application. Here's the command I'm using:
SELECT *
FROM OPENROWSET(
'MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=E:\MPS_ REPT_DATA; ',
'SELECT TOP 100 PERCENT * FROM E:\MPS_REPT_DATA\test1.txt ')
My question is this: is it possible to change the delimiter used to separate columns?
Thanks,
Jim
I am using OPENROWSET to read a delimited text file created by another application. Here's the command I'm using:
SELECT *
FROM OPENROWSET(
'MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=E:\MPS_
'SELECT TOP 100 PERCENT * FROM E:\MPS_REPT_DATA\test1.txt
My question is this: is it possible to change the delimiter used to separate columns?
Thanks,
Jim
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.eggheadcafe.com/software/aspnet/32530255/openrowset-dynamic-sql.aspx
https://www.experts-exchange.com/questions/20239469/OpenRowSet-dynamic-query.html