timestamp purpose and use if it

  • Thread starter Thread starter mesut
  • Start date Start date
M

mesut

Hi there,

I'm using a creationDate and ModifiedDate in all my tables with
Datatype: DateTime.
In most of my tables I need to do update/delete.

Do I also need to add a field with data type timestamp in my CRUD
tables ?
Why do I need timestamp field ?
how to use it I mean is it just define the timestamp field in those
tables? how does that work then?

thanks mesut
 
The timestamp data type has special rules: you can't update it
yourself, and it always gets updated with any row update. As such, it
is a very quick way of testing a row for changes, since it is
impossible to update the row without updating the timestamp. In
reality, it is just a database-wide counter... every row update
increments the counter etc.

You don't *need* a timestamp, but it can be very useful in a lot of
scenarios. Many ORM tools will recognise timestamps and make
appropriate concurrency checks (rather than checking every column for
updates).

Marc
 
The timestamp data type has special rules: you can't update it
yourself, and it always gets updated with any row update. As such, it
is a very quick way of testing a row for changes, since it is
impossible to update the row without updating the timestamp. In
reality, it is just a database-wide counter... every row update
increments the counter etc.

You don't *need* a timestamp, but it can be very useful in a lot of
scenarios. Many ORM tools will recognise timestamps and make
appropriate concurrency checks (rather than checking every column for
updates).

Marc

Hi Marc,

thanks for the info.. So if I understand well it's useful for the
concurrency checking. Any simple sample you can provide? at least can
you give the keywords to google?

thanks again,
mesut
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

C# timestamp datatype? 3
>> sql timestamp 4
timestamp handle 5
Database Sync Question 4
ToolTip over a DataGridView row? 4
Formatting Question 2
SQL Timestamp field for Access use 28
Date Timestamp 1

Back
Top