I have SQL Server 2014 (v12.0.2000). On that server I execute BULK INSERT for about 200 files in range from 1 kB to 35 MB in this way:
BULK INSERT [MYDB].[dbo].[my_table]
FROM 'C:\Docs\csv\001.csv'
WITH
(FIRSTROW = 1,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n',
DATAFILETYPE = 'char',
TABLOCK,
KEEPNULLS);
All my .csv files are syntactically correct. In that way everything works for 2 days.
After that I suddenly get this error:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
And even files that have been inserted previously now are discarded. When I try to insert manually file with one row, it also raises error.
P.S. There is enough disk space on my hard drive.
This issue occurs because of an error in SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, or SQL Server 2014.
And the proposed solution was to install Cumulative Update 1 for SQL Server 2014
Possible solution: Try rebuilding indexes
If the error is related to BULK INSERT method
SELECT * FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)};
DefaultDir=C:\Docs\csv\;',
'SELECT * FROM 001.csv')
SELECT
*
FROM
OPENROWSET
(
'Microsoft.ACE.OLEDB.12.0','Text;Database=C:\Docs\csv\;IMEX=1;','SELECT *
FROM 001.csv'
) t
Msg 0, Level 11, State 0, Line 0. A severe error occurred on the current command. The results, if any, should be discarded.
Look in the SQL Log for more details.
12.0.2000.
You are running an unsupported service pack level for SQL 2014. You should apply the latest service pack before doing much more troubleshooting of a problem like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With