# Error when trying to conect to MS SQL backend

**URL:** https://forum.djangoproject.com/t/error-when-trying-to-conect-to-ms-sql-backend/8464
**Category:** Using the ORM
**Created:** [June 22, 2021, 1:14pm UTC](https://forum.djangoproject.com/t/error-when-trying-to-conect-to-ms-sql-backend/8464 "2021-06-22T13:14:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pmasonBWC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmasonbwc/32/5135_2.png) [@pmasonBWC](https://forum.djangoproject.com/u/pmasonBWC)
#### Post date: [June 22, 2021, 1:14pm UTC](https://forum.djangoproject.com/t/error-when-trying-to-conect-to-ms-sql-backend/8464/1 "2021-06-22T13:14:34Z")

</div>

In the follow on to the previous post I’m getting what appears to be a common issue (there are posts from June/August 2020 with the same error):

> (\<class ‘django.core.exceptions.ImproperlyConfigured’\>, ImproperlyConfigured(“‘sql\_server.pyodbc’ isn’t an available database backend or couldn’t be imported. Check the above exception. To use one of the built-in backends, use ‘django.db.backends.XXX’, where XXX is one of:\n ‘mysql’, ‘oracle’, ‘postgresql’, ‘sqlite3’”), \<traceback object at 0x7f4396885b40\>)

But no-one posted back the solutions.

The code breaks at line 122 in Utils.py:

```auto
        if backend_name not in ['django.db.backends.%s' % b for b in builtin_backends]:
            backend_reprs = map(repr, sorted(builtin_backends))
            raise ImproperlyConfigured(
                "%r isn't an available database backend or couldn't be "
                "imported. Check the above exception. To use one of the "
                "built-in backends, use 'django.db.backends.XXX', where XXX "
                "is one of:\n"
                " %s" % (backend_name, ", ".join(backend_reprs))
            ) from e_user

```

And as can be seen the issue is obvious…MS SQL server clearly isn’t a member of django.db.backends.

Which indicates that I’m missing a reference somewhere. The [django-mssql-backend · PyPI](https://pypi.org/project/django-mssql-backend/) site says that this is all that is needed:

```auto
DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',

```

But clearly it isn’t. Anyone know how to fix this?

---

<div class="post-metadata">

### Author: ![pmasonBWC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pmasonbwc/32/5135_2.png) [@pmasonBWC](https://forum.djangoproject.com/u/pmasonBWC)
#### Post date: [June 23, 2021, 12:46pm UTC](https://forum.djangoproject.com/t/error-when-trying-to-conect-to-ms-sql-backend/8464/2 "2021-06-23T12:46:40Z")

</div>

OK, so connecting to a SQL server is niche. That’s useful to know.

It turns out that if I run my project ye olde worlde way “python3 manage.py runserver” it works…or at least it moves on to an error about the very basic model I’ve created.

So the issue is my IDE, PyCharm. I’ll take the matter up with them and soldier on without debugging tools.

---

<div class="post-metadata">

### Author: ![Nivedha-Marimuthu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/nivedha-marimuthu/32/10082_2.png) [@Nivedha-Marimuthu](https://forum.djangoproject.com/u/Nivedha-Marimuthu)
#### Post date: [September 14, 2022, 8:23pm UTC](https://forum.djangoproject.com/t/error-when-trying-to-conect-to-ms-sql-backend/8464/3 "2022-09-14T20:23:04Z")

</div>

Is there an solution for this?
