Entity Framework 6 supports SQL Server 2000?

五迷三道 提交于 2019-11-30 18:59:41

Although there is code to handle SQL Server 2000, there are valid queries that Entity Framework simply cannot translate to any form of SQL that will be accepted by that version of SQL Server. Such queries will result in run-time exceptions. The exact same queries do work on a model built for SQL Server 2005 or newer. The main limitation is that there is no good way of getting the effect of APPLY in that version of SQL Server.

Basically, you can use EF with SQL Server 2000, but it's less useful than on newer versions, and you need to make sure that each and every query your application uses actually gets tested, because the fact that it compiles doesn't mean that it will work.

Also, parts of the designer explicitly check for the SQL Server versions and reject SQL Server 2000.

Saman Gholami

Yes, you can use EF 6.x for SQL Server 2000, I'm using this for SQL Server 2000 without any problems.

But your should set something in your .edmx file of your model.

Open your model .edmx file with notepad or any text editor, then change this line :

<Schema Namespace="MyModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2000" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">

As you can see, ProviderManifestToken="2000" shows your SQL Server version.EF look this section for generating T-SQL queries and generate scripts under the version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!