title: Django ProgrammingError [42S02] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server] Invalid object name
body: <p>I am using <code>Django version 2.0.2.</code> My Django application is connected to <code>MS SQL</code> (connection below).</p>
  
  <pre><code>  DATABASES = {
      'default': {
          'ENGINE': 'sql_server.pyodbc',
          'NAME': 'projectcreation',
          'HOST': 'Host_name',
          'OPTIONS': {
          'driver': 'ODBC Driver 13 for SQL Server',
          'dns': 'projectcreation'
          },
  }
  }
  </code></pre>
  
  <p>So, I am getting the following error when trying to access my Django application:  </p>
  
  <blockquote>
    <p>django.db.utils.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'projectcreation_partner'. (208) (SQLExecDirectW)")  </p>
  </blockquote>
  
  <p>I believe that when I created tables (makemigrations+migrate) instead of creating tables that look like this: <code>[projectcreation].[dbo].[projectcreation_partner]</code> it created tables like this <code>[projectcreation].[username].[projectcreation_partner]</code>. So instead putting <code>dbo</code> which I actually expected to see it put my username..   </p>
  
  <p>I suppose that when the app tries to connect to db it cannot find it because it is looking for one containing dbo not username.. Of course, I could be wrong.. </p>
  
  <p>If you need more information please let me know, any help is greatly appreciated.</p>
  
  <p>Note: both db and application are called "projectcreation", "partner" is name of one of the models. </p>