Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The database driver doesn't support modern datatime types. #185

Open
tbenny opened this issue Nov 2, 2018 · 3 comments
Open

The database driver doesn't support modern datatime types. #185

tbenny opened this issue Nov 2, 2018 · 3 comments

Comments

@tbenny
Copy link

tbenny commented Nov 2, 2018

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,
'host_is_server': True,
'unicode_results': True,
'driver': 'FreeTDS',
},
},
}

Our ubuntu version is 18.10

@wil
Copy link

wil commented Feb 2, 2019

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
},

@nadyr-mg
Copy link

nadyr-mg commented Jul 8, 2019

@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)

@wil
Copy link

wil commented Jul 21, 2019

I'm glad it helped @marshygeek.
@tbenny have you tried the extra_params option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants