RRinTetons
IS-IT--Management
SQL Server 2005, 2008
Working from various web page examples of OPENROWSET I created two files on the server:
C:\RowSetWork\values.txt
C:\RowSetWork\format.fmt
values.txt looks like:
format.fmt is:
I call:
and get an error:
I can paste that file path into a command window and the file opens right up, ditto values.txt.
I'm stumped. That's about as simple as I can make it and it's not working.
????
-
Richard Ray
Jackson Hole Mountain Resort
Working from various web page examples of OPENROWSET I created two files on the server:
C:\RowSetWork\values.txt
C:\RowSetWork\format.fmt
values.txt looks like:
Code:
1 Data Item 1
2 Data Item 2
3 Data Item 3
format.fmt is:
Code:
9.0
2
1 SQLCHAR 0 10 "\t" 1 ID SQL_Latin1_General_Cp437_BIN
2 SQLCHAR 0 40 "\r\n" 2 Description SQL_Latin1_General_Cp437_BIN
I call:
Code:
SELECT a.*
FROM OPENROWSET(BULK 'C:\RowSetWork\values.txt',
FORMATFILE = 'C:\RowSetWork\format.fmt') AS a;
and get an error:
Code:
Msg 4862, Level 16, State 1, Line 1
Cannot bulk load because the file "C:\RowSetWork\format.fmt" could not be read. Operating system error code (null).
I can paste that file path into a command window and the file opens right up, ditto values.txt.
I'm stumped. That's about as simple as I can make it and it's not working.
????
-
Richard Ray
Jackson Hole Mountain Resort