Assume that you use the sqlcmd utility to connect to a remote instance of Microsoft SQL Server 2012 or SQL Server 2014 and run a query with the -Q and -b option. When the sqlcmd connection is terminated unexpectedly before the query is finished, the exit code of sqlcmd indicates success.
The expected outcome is that when the sqlcmd connection is terminated, an error message is reported by sqlcmd that indicates that the connection is lost and the exit code is 1 that indicates failure.
The sqlcmd connection can be terminated in these ways: the SQL Server KILL command, SQL Server service shutdown, SQL Server restart during patching, network issues, and others.
After you apply this update, an error message together with severity 19 is sent back for the conditions described previously.
The issue was first fixed in the following cumulative update of SQL Server:
Recommendation: Install the latest cumulative update for SQL Server
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. We recommend that you download and install the latest cumulative updates for SQL Server: