Domanda

I can't seem to find in the official documentation if SQL Server 2005 supports datetime2 data type?

È stato utile?

Soluzione

Apparently it does not. Here are the supported data types.

EDIT:

According to the following sources datetime2 was introduced in SQL Server 2008.

http://blogs.msdn.com/b/manisblog/archive/2007/08/28/sql-server-2008-enhancements-in-date-and-time-data-types.aspx

http://www.4guysfromrolla.com/articles/101508-1.aspx

Altri suggerimenti

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.

maybe you encounter this problem:

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

you can see the solution as following:

Using SQL Server 2008 and SQL Server 2005 and date time

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top