OK I tried this:set ANSI_WARNINGS OffGOBULK INSERT updateFROM 'C:\update.txt'WITH(FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')set ANSI_WARNINGS OnGO
and got this:Msg 102, Level 15, State 1, Line 2Incorrect syntax near 'C:\update.txt'.Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 3, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 4, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 5, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 6, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 7, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 8, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 9, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 10, column 5 (CatalogNumber).Msg 4864, Level 16, State 1, Line 1Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 11, column 5 (CatalogNumber).Msg 4865, Level 16, State 1, Line 1Cannot bulk load because the maximum number of errors (10) was exceeded.Msg 7399, Level 16, State 1, Line 1The 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 1Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
quote:
Originally posted by jackv
Something like:BULKINSERT mytableFROM 'h:\sqlserver-dba-csv.txt'WITH(FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')--ref:http://www.sqlserver-dba.com/2011/05/bulk-insert-csv-into-a-sql-server-table.htmlJack Vamvas--------------------http://www.sqlserver-dba.com