FIX: "EXCEPTION_INVALID_CRT_PARAMETER" error with BULK INSERT statement in SQL Server 2016

Applies to: SQL Server 2016 Enterprise CoreSQL Server 2016 EnterpriseSQL Server 2016 Developer

Symptoms


When you execute a BULK INSERT statement in Microsoft SQL Server 2016, the instance of SQL Server may crash. Additionally, an error message that resembles the following is logged in the SQL Server error log:

date time spid118 ***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\LOG\SQLDumpfile.txt
 

date time spid118 SqlDumpExceptionHandler: Process 118 generated fatal exception c000000d EXCEPTION_INVALID_CRT_PARAMETER. SQL Server is terminating this process.

date time spid118 * *******************************************************************************

date time spid118 *

date time spid118 * BEGIN STACK DUMP:

date time spid118 * Datatime spid 118

date time spid118 *

date time spid118 *

date time spid118 * Exception Address = 00007FF82FAA8A5C Module(KERNELBASE+0000000000008A5C)

date time spid118 * Exception Code = c000000d EXCEPTION_INVALID_CRT_PARAMETER

date time spid118 * Input Buffer 318 bytes -

date time spid118 * BULK INSERT Tablename FROM Datafile.

date time spid118 * txt' WITH (DATAFILETYPE='char', FIELDTERMINATOR='\0',CODEPAGE='ACP', ROW

date time spid118 * S_PER_BATCH=1);

date time spid118 *

date time spid118 *

date time spid118 * MODULE

Resolution


This fix is included in the following updates:

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the terminology Microsoft uses to describe software updates.