0
votes

Using Sql Azure with entity framework. Most of our tables have a date column where we store when the record was edited and by whom. Is there a benefit of making those columns into a timestamp column for the following reasons

  1. Does timestamp help if we want to synchronize this db with another db with SQL Data Sync i.e. if we have a timestamp column that we can use both for our logging and data sync especially if data sync insists on all the tables having a timestamp column
  2. Will having this column help with optimistic concurrency (via entity framework)?
1
DO you know waht a timestamp column is in sql server speak? I.e. do you know that TImestamp is not a date / time data type but a database running version number as per documentation and can you imagine how to sync that between two instances?TomTom
Depends on which date-related datatype you're really using. You are aware that the standard DATETIME type has an accuracy of only 3.33ms ? To me, that's not accurate enough for a timestamping that I need for concurrency checks.... the TIMESTAMP (or now: ROWVERSION) datatype is much better in that it provides consecutive binary-encoded numbers everytime something changes - no matter how close after another event - the value will be different (no problem with time accuracy)marc_s
tomtom - Got your point that timestamp does not replace datetime for logging but we do not need actual datetime just the order (we store logs in a separate table) - sorry if I wasnt clear. mark_s - thanks for the inputs. Looks like if I need better concurrency checks I would need to get a timestamp column in my tablesuser275157

1 Answers

1
votes

To answer your first question, No. the SQL Data Sync service will create its own change tracking mechanism and you cant configure it to reuse your timestamp column.