I'm using SQL Server 2017. I'm trying to BULK INSERT
into SQL Server a number of .DAT
files that are delimited with a Pilcrow (¶) for columns and a Lower Case Thorn (þ) for text (this is a common delimiter format among e-discovery platforms). Here is an example of the data files:
My understanding is that I need a format file to do this. I've created the following FMT file (note I have a "dummy" line that adds a preceding text delimiter):
I then run the following SQL statement:
BULK INSERT [dbo].[tblERRORS]
FROM 'C:\Users\myName\Documents\Errors\ErrorFile.dat'
WITH (FirstRow = 2, FORMATFILE = 'C:\Users\myName\Documents\Errors\Errors.fmt');
GO
I get the following errors:
Msg 4832, Level 16, State 1, Line 201
Bulk load: An unexpected end of file was encountered in the data file.Msg 7399, Level 16, State 1, Line 201
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.Msg 7330, Level 16, State 2, Line 201
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
NOTE: I've also tried changing the last line in the FMT file to "þ\r\n" which doesn't work.
Any suggestions would be appreciated.
Thank you.