Contents Index Working with column defaults in Sybase Central The user ID default

ASA SQL User's Guide
  Ensuring Data Integrity
    Using column defaults

Current date and time defaults


For columns with the DATE, TIME, or TIMESTAMP data type, you can use the current date, current time, or current timestamp as a default. The default you choose must be compatible with the column's data type.

Useful examples of current date default 

A current date default might be useful to record:

Current timestamp 

The current timestamp is similar to the current date default, but offers greater accuracy. For example, a user of a contact management application may have several contacts with a single customer in one day: the current timestamp default would be useful to distinguish these contacts.

Since it records a date and the time down to a precision of millionths of a second, you may also find the current timestamp useful when the sequence of events is important in a database.

For more information about timestamps, times, and dates, see SQL Data Types.


Contents Index Working with column defaults in Sybase Central The user ID default