J'ai créé vue qui doit utiliser FULL OUTER JOIN
.Comment créer PRIMARY KEY dans VIEW qui utilise OUTER JOIN
Je souhaite utiliser cette vue dans EDMX
avec l'approche DbFirst.
Mais le EDMX
est la génération d'avertissement suivant:
<!--Errors Found During Generation: warning 6013: The table/view 'MyView' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.
J'ai essayé de résoudre ce problème en ajoutant CREATE UNIQUE CLUSTERED INDEX PK_MyView ON [dbo].[MyView] (Id)
Mais dit Sql: Cannot create index on view "dbo.MyView" because it uses a LEFT, RIGHT, or FULL OUTER join, and no OUTER joins are allowed in indexed views. Consider using an INNER join instead.
Y at-il un moyen d'ajouter vue sans PK vers edmx ou ajoutez PK à la vue.
Je dois indexer la vue car Entity Framework en a besoin. Par indice, je veux dire l'index comme clé prinaire. –