title: Pymssql Error 20017 after upgrading to Python 3.6 and SQL Server 2016
body: <p>We've had a Flask application using pymssql running for 1.5 years under Python 2.7 and SQL Server 2012. We moved the application to a new set of servers and upgraded the Flask app to Python 3.6 and a new database server to SQL Server 2016. They're both Windows servers.</p>
  
  <p>Since then, we've been getting intermittent 20017 errors:</p>
  
  <p>pymssql.OperationalError(20017, b'DB-Lib error message 20017, severity 9:\nUnexpected EOF from the server (xx.xx.xx.xx:1433)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (xx.xx.xx.xx:1433)\n')</p>
  
  <p>Only a small percentage of the calls return this, but enough to be causing problems. I can provide specific versions of everything we're running.</p>
  
  <p>One solution proposed is to switch to pyodbc, but we have hundreds of queries and stored procedure calls, many with UUIDs, which pyodbc doesn't handle nearly as cleanly as pymssql.</p>
  
  <p>I've installed pymssql via a precompiled wheel (pymssql-2.1.3-cp36-cp36m-win_amd64) because pip can't build it without an older version.</p>
  
  <p>Any ideas on debugging or fixing this would be helpful.</p>