I can’t understand how this happens.
Here is an example file that I am trying to upload to SQL Server 2005:
***A NICE HEADER HERE*** 0000001234|SSNV|00013893-03JUN09 0000005678|ABCD|00013893-03JUN09 0000009112|0000|00013893-03JUN09 0000009112|0000|00013893-03JUN09
Here is my main insert:
BULK INSERT sometable FROM 'E:\filefromabove.txt WITH ( FIRSTROW = 2, FIELDTERMINATOR= '|', ROWTERMINATOR = '\n' )
But for some reason, the only way I can get is:
0000005678|ABCD|00013893-03JUN09 0000009112|0000|00013893-03JUN09 0000009112|0000|00013893-03JUN09
The first entry is always skipped if I do not delete the header at all and do not use the FIRSTROW parameter. How is this possible?
Thanks in advance!
sql sql-server-2005 bulkinsert
gibbo
source share