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
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)
After you create the view using schemabinding
you can add a primary key to it:
CREATE VIEW Colors WITH SCHEMABINDING
AS SELECT Color='yellow', ColorCount=100
GO
CREATE UNIQUE CLUSTERED INDEX PK_Colors ON Colors (Color)