Generete value during insert


Lets say I have sql table like create table event(id identity, store integer, id_inside_store integer, (and other fields))
where id is primary index (of course) but  store, id_inside_store is secondary UNIQUE index. 
normally with direct sql i would say 
insert into event(store, id_inside_store, other fields) select 10, max(id_inside_store)+1 from event where store = 10, other values  from event 

Is this possible with aurelius entities ? Only one table of our 380 tables  has this need, not a big issue, but just learning .

Hi Mika,

Unfortunately you can't have SQL expressions for values in the INSERT statements.
What you can do is simply get the max(id_inside_store) + 1 value in a previous select and then set the value in the object before saving it.