title: Why can I connect to Azure MS SQL with tsql but not pymssql?
body: <p>Where I am today:</p>
  
  <pre><code>TDSVER=7.3 tsql -H example.database.windows.net -U me -D ExampleDB -p 1433 -P notreallymypassword
  </code></pre>
  
  <p>This does not:</p>
  
  <pre><code>&gt;&gt;&gt; import pymssql
  &gt;&gt;&gt; pymssql.connect('example.database.windows.net', user='me', password='notreallymypassword', database='ExampleDB', tds_version='7.3')
  </code></pre>
  
  <p>It fails with </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "pymssql.pyx", line 635, in pymssql.connect (pymssql.c:10734)
    File "_mssql.pyx", line 1902, in _mssql.connect (_mssql.c:21821)
    File "_mssql.pyx", line 577, in _mssql.MSSQLConnection.__init__ (_mssql.c:6214)
    File "_mssql.pyx", line 1704, in _mssql._tds_ver_str_to_constant (_mssql.c:18845)
  _mssql.MSSQLException: unrecognized tds version: 7.3
  </code></pre>
  
  <p>Okay. Well, that's... strange. So I went back and tried the <code>tsql</code> using <code>TDSVER=7.2</code>, which seemed to work fine.</p>
  
  <p>Trying to connect with <code>tds_version='7.2'</code> gives me:</p>
  
  <pre><code>Traceback (most recent call last):
    File "pymssql.pyx", line 635, in pymssql.connect (pymssql.c:10734)
    File "_mssql.pyx", line 1902, in _mssql.connect (_mssql.c:21821)
    File "_mssql.pyx", line 637, in _mssql.MSSQLConnection.__init__ (_mssql.c:6581)
    File "_mssql.pyx", line 1630, in _mssql.maybe_raise_MSSQLDatabaseException (_mssql.c:17524)
  _mssql.MSSQLDatabaseException: (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (datawhse.database.
  windows.net:1433)\n')
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "pymssql.pyx", line 641, in pymssql.connect (pymssql.c:10824)
  pymssql.OperationalError: (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (datawhse.database.windo
  ws.net:1433)\n')
  </code></pre>
  
  <p>So, what gives?</p>
  
  <p><strong>Update 1:</strong>
  pyodbc <em>also</em> fails to connect:</p>
  
  <pre><code>conn = pyodbc.connect('SERVER=example.database.windows.net;Driver=FreeTDS;UID=me@example.database.windows.net;PWD=notmyrealpassword;'
  , ansi=True)
  </code></pre>
  
  <p>My ~/.odbcinst.ini:</p>
  
  <pre><code>[FreeTDS]
  Description     = MS SQL driver
  Driver          = /usr/lib64/libtdsodbc.so.0
  Driver64        = /usr/lib64/libtdsodbc.so.0
  Setup           = /usr/lib64/libtdsS.so.0
  Setup64         = /usr/lib64/libtdsS.so.0
  UsageCount      = 1
  CPTimeout       =
  CPReuse         =
  Trace           = Yes
  </code></pre>
  
  <p>And this output:</p>
  
  <pre><code>⚘ odbcinst -j
  unixODBC 2.3.1
  DRIVERS............: /etc/odbcinst.ini
  SYSTEM DATA SOURCES: /etc/odbc.ini
  FILE DATA SOURCES..: /etc/ODBCDataSources
  USER DATA SOURCES..: /home/me/.odbc.ini
  SQLULEN Size.......: 8
  SQLLEN Size........: 8
  SQLSETPOSIROW Size.: 8
  </code></pre>