Error 6002: The table/view does not have a primary key defined

前端 未结 5 1875
刺人心
刺人心 2020-12-02 22:27

I am getting a couple of these errors that make perfect sense as they are on views. I understand what they mean, however I am looking for a way to prevent that warning messa

5条回答
  •  伪装坚强ぢ
    2020-12-02 23:04

    I have had luck in EF4 and EF5 using the technique described by http://www.hilmiaric.com/?p=95 using rownumber as the ID

    SELECT ISNULL((ROW_NUMBER() OVER (ORDER BY XXX ASC)), 0) AS 'ID',

    But I don't have a solution for EF5 and above. Last tried on 6.1.3

提交回复
热议问题