What is the preferred sql server column definition to use for a LINQ to SQL Version property?

Posted by Mike Two on Stack Overflow See other posts from Stack Overflow or by Mike Two
Published on 2010-03-09T18:58:05Z Indexed on 2010/03/22 19:01 UTC
Read the original article Hit count: 251

Filed under:
|
|

We are using the IsVersion property on the ColumnAttribute on a property in a LINQ to SQL class for optimistic concurrency checks. What should the column definition be in the database?

Currently we are using

version_number int NOT NULL IDENTITY (1, 1) 

Do we need Identity? Can we get LINQ to SQL to update the version number for us? The only issue with Identity is that every row has a different number. We'd like to see the number increment by 1 when the row is updated.

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about sql-server-2008