i have a table which i use to implement a sequence in Sql Server 2008. The sequence table has just 1 column which is an integer.
I want to know if i can do something like this
update dbo.MySequence set val=val+1 output inserted.val
and return value without using stored procedures in Entity Framework.
Thanks.
Why to avoid stored procedures? Using stored procedures is part of using EF. You don’t have to create stored procedure but you still have to call direct SQL (for example with
context.ExecuteStoreQuery). For example on MS SQL you can use:But it is better to have sequences named (with additional column).