• Support for Django v1.3 has been removed.
  • Corrected DB-API 2 testing documentation.
  • Fixed issue with slicing logic that could prevent the compiler from finding and mapping column aliases properly.
  • Improved the “return ID from insert” logic so it can properly extract the column data type from user defined fields with custom data type strings.
  • Fixed case for identifiers in introspection. Thanks Mikhail Denisenko.
  • Added option use_legacy_date_fields (defaults to True) to allow changing the DatabaseCreation.data_types to not use the Microsoft preferred date data types that were added with SQL Server 2008. django-mssql issue #31
  • Improved accuracy of field type guessing with inspectdb. See Introspecting custom fields
  • Fixed issue with identity insert using a cursor to the wrong database in a multi-database environment. Thanks Mikhail Denisenko
  • Fixed constraint checking. django-mssql issue #35 Thanks Mikhail Denisenko
  • Enabled can_introspect_autofield database feature. Django ticket #21097
  • Any date related field should now return from the database as the appropriate Python type, instead of always being a datetime.
  • Backend now supports doing date lookups using a string. E.g. Article.objects.filter(pub_date__startswith='2005')
  • check_constraints will now check all disabled and enabled constraints. This change was made to match the behavior tested by backends.FkConstraintsTests.test.test_check_constraints.
  • Improved date_interval_sql support for the various date/time related datatypes. The timedelta value will control whether the database will DATEADD using DAY or SECOND. Trying to add seconds to a date, or days to a time will generate database exceptions.
  • Fixed issue with provider detection that prevented DataTypeCompatibility=80 from being automatically added to the connection string for the native client providers.
  • Fixed SQL generation error that occured when ordering the query based upon a column that is not being returned.
  • Added savepoint support. MS SQL Server doesn’t support savepoint commits and will no-op it. Other databases, e.g. postgresql, mostly use it as a way of freeing server resources in the middle of a transaction. Thanks Martijn Pieters.
  • Minor cleanup of limit/offset SQL mangling to allow custom aggregates that require multiple column replacements. django-mssql issue #40 Thanks Martijn Pieters for initial patch and tests.
  • Savepoints cannot be used with MARS connections. django-mssql issue #41



  • Backend now supports returning the ID from an insert without needing an additional query. This is disabled for SQL Server 2000 (assuming that version still works with this backend). django-mssql issue #17
  • Subqueries will have their ordering removed because SQL Server only supports it when using TOP or FOR XML. This relies upon the with_col_aliases argument to SQLCompiler.as_sql only being True when the query is a subquery, which is currently the case for all usages in Django 1.5 master. django-mssql issue #18
  • UPDATE statements will now return the number of rows affected, instead of -1. django-mssql issue #19
  • Apply fix for Django ticket #12192. If QuerySet slicing would result in LIMIT 0, then it shouldn’t reach the database because there will be no response.
  • Implemented DatabaseOperation cache_key_culling_sql. Django ticket #18330
  • Fixed cast_avg_to_float so that it only controls the cast for AVG and not mapping other aggregates.
  • Improved IP address detection of HOST setting. django-mssql issue #21
  • Set database feature ignores_nulls_in_unique_constraints = False because MSSQL cannot ignore NULLs in unique constraints.
  • django-mssql issue #26 Documented clustered index issue with Azure SQL. See Azure requires clustered indices.


  • Ensure master connection connects to the correct database name when TEST_NAME is not defined.
  • Connection.close() will now reset adoConn to make sure it’s gone before the CoUninitialize.
  • Changed provider default from ‘SQLOLEDB’ to ‘SQLNCLI10’ with MARS enabled.
  • Added RawStoredProcedureManager, which provides raw_callproc that works the same as raw, except expects the name of a stored procedure that returns a result set that matches the model.
  • Documented known issue with database introspection with DEBUG = True and column names containing ‘%’. See Introspecting tables with ‘%’ columns.
  • Fixed error with iendswith string format operator.


  • Updated SQLInsertCompiler to work with Django 1.4
  • Added support for disable_constraint_checking, which is required for loaddata to work properly.
  • Implemented DatabaseOperations.date_interval_sql to allow using expressions like end__lte=F('start')+delta.
  • Fixed date part extraction for week_day.
  • DatabaseWrapper reports vendor as ‘microsoft’.
  • AVG function now matches core backend behaviors and will auto-cast to float, instead of maintaining datatype. Set database OPTIONS setting disable_avg_cast to turn off the auto-cast behavior.
  • StdDev and Variance aggregate functions are now supported and will map to the proper MSSQL named functions. Includes work around for Django ticket #18334.
  • Monkey patched django.db.backends.util.CursorWrapper to allow using cursors as ContextManagers in Python 2.7. Django ticket #17671.