Open tbenny opened 6 years ago
Could the issue be the TDS version used? According to this FreeTDS page you need to be using TDS version 7.3 and above in order to support DATETIME2, etc. I have not tested it, but it may be worth trying the following:
'OPTIONS': {
'host_is_server': True,
'unicode_results': True,
'driver': 'FreeTDS',
'extra_params': "TDS_VERSION=7.3", # force the TDS version to 7.3 or 7.4 or 8.0
},
@wil I had the same problem, so I was searching for an answer for a whole day. You saved my life, thank you! ('extra_params' option solved the issue)
I'm glad it helped @marshygeek.
@tbenny have you tried the extra_params
option?
When we use Freetds and unixodbc with pyodbc-azure package in our Django application , we are getting the error while connecting to MSSql Server 2016 django.core.exceptions.ImproperlyConfigured: The database driver doesn't support modern datatime types.
Our settings.py is as follows
DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'quickstartdb', 'USER': 'xx', 'PASSWORD': 'password', 'HOST': '192.xxx.xx.xx', 'PORT': '1433', 'OPTIONS': {
'AUTOCOMMIT': True,
}
Our ubuntu version is 18.10