How do you add a primary key to a sql view? - Or alternate way to link views to LINQ-2-Entities

后端 未结 2 1016
我寻月下人不归
我寻月下人不归 2021-02-05 23:54

I\'m adding a very simple view (or trying to) to my entities object model. The database is in SQL Server 2008. I\'m on .Net 3.5 (SP1) using C#.

The view has two fields

2条回答
  •  离开以前
    2021-02-06 00:24

    I dont know if this will help you, but you can create a primary key using a multi-statement table-valued function.

    I cant find any ref to a primary key for a view, but i know it can be done with a table function.

    CREATE FUNCTION (Transact-SQL)

提交回复
热议问题