0

I tried the following query:

select *
from openrowset('MADASQL'
               ,'Driver={Microsoft Text Driver (*.txt; *.csv)}'
               ,'select * from C:\test.txt')

but it failed with an error:

Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)"

So I tried:

SELECT  *
FROM OPENROWSET(BULK 'C:\test.txt', 
                FORMATFILE= 'C:\test.xml') AS a

it failed with

Cannot bulk load. The file "C:\test.txt" does not exist

I have check the path and find nothing wrong.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user618520
  • 139
  • 1
  • 11

0 Answers0