Does SQL Server 2005 support datetime2

2019-08-09 04:21发布

问题:

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

回答1:

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



回答2:

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.



回答3:

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