views:

29

answers:

1

I am sure I am not the first one to struggle with this.

I am using Entity Framework 1 (VS2008) and one of the columns in the table is ModifiedDate. It has DefaultValue in SQL Server (getdate()); so I would like to leave it the DB to do the generation. However, generated SQL has INSERT (... ModifiedDate) VALUES (... null), and the default value doesn't get inserted.

Is it possible to not specify this column at all?

A: 

By setting StoreGeneratedPattern in SSDL.

Craig Stuntz
Craig, thank you! In conversation with Nick above I came to the same conclusion; but when Nick deleted the thread (because it veered into LINQ to SQL territory) - my belated finding was deleted as well. It's nice to have your answer - so others can benefit!
Felix