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.