The version of SQL Server in use does not support datatype datetime2? The version of SQL Server in use does not support datatype datetime2? sql-server sql-server

The version of SQL Server in use does not support datatype datetime2?


Have you tried to open your EDMX file with XML Editor and check the value of ProviderManifestToken. It may help to change from ProviderManifestToken=”2008” to ProviderManifestToken=”2005”.


In addition to @Mithrandir answer validate that your database is running in compatibility level set to 100 (SQL 2008).

You don't have to use DATETIME2 in your database to get this error. This error happens usually once you add required (NOT NULL) DATETIME column to existing table and you don't set the value prior to saving the entity to database. In such case .NET will send default value which is 1.1.0001 and this value doesn't fit into DATETIME range. This (or something similar) will be source of your problem.


Open your EDMX in a file editor (or “open with…” in Visual Studio and select XML Editor). At the top you will find the storage model and it has an attribute ProviderManifestToken. This has should have the value 2008. Change that to 2005, recompile and everything works.

NOTE: You'll have to do this every time you update the model from database.