Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
现在 Sql Server 2012(包括 SQL Server Express 2012)具有SEQUENCE与 Oracle 类似的功能,如此处、此处和此处所述。
SEQUENCE
我可以sequence像这样得到下一个,SELECT NEXT VALUE FOR SeqName
sequence
SELECT NEXT VALUE FOR SeqName
但是我如何使用 Entity Framework 5 从我的代码中做到这一点?
我让它SqlQuery像这样工作..
SqlQuery
int sequence = context.Database.SqlQuery<int>("SELECT NEXT VALUE FOR MySequenceName").FirstOrDefault();