FIX: Insert with SUBSTRING Operation Fails if JOIN Comparison is Based on NULL Values and LIKE Clause

March 16, 2011 by admin · Leave a Comment 

Symptoms
If you compare columns in two tables by using the LIKE clause in a Join operation and the data in one of the columns is null, and you then perform an INSERT operation into a table with a SUBSTRING function, an access violation may occur.
The client terminates with the following error message:

ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 7 generated fatal exception c0000005
EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
Connection Broken
Resolution
Change the LIKE clause to an equality operator “=” (equal sign).