Sybase Question:

Download Job Interview Questions and Answers PDF

The timestamp datatype in Sybase?

Sybase Interview Question
Sybase Interview Question

Answer:

The timestamp datatype is user-defined datatype supplied by Sybase, defined as:

varbinary(8) NULL

It has a special use when used to define a table column. A table may have at most one column of type timestamp, and whenever a row containing a timestamp column is inserted or updated the value in the timestamp column is automatically updated. This much is covered in the documentation.

What isn't covered is what the values placed in timestamp columns actually represent. It is a common misconception that timestamp values bear some relation to calendar date and/or clock time. They don't - the datatype is badly-named. SQL Server keeps a counter that is incremented for every write operation - you can see its current value via the global variable @@DBTS (though don't try and use this value to predict what will get inserted into a timestamp column as every connection shares the same counter.)

Download Sybase Interview Questions And Answers PDF

Previous QuestionNext Question
How do I remove duplicate rows from a table in Sybase?How do I check if log truncation is blocked in Sybase?