Timestamp datatype  Date and time datatypes

Chapter 1: System and User-Defined Datatypes

Creating a timestamp column

If you create a column named timestamp without specifying a datatype, Adaptive Server defines the column as a timestamp datatype:

create table testing 
    (c1 int, timestamp, c2 int)

You can also explicitly assign the timestamp datatype to a column named timestamp:

create table testing 
    (c1 int, timestamp timestamp, c2 int)

or to a column with another name:

create table testing 
    (c1 int, t_stamp timestamp,c2 int)

You can create a column named timestamp and assign it another datatype (although this may be confusing to other users and does not allow the use of the browse functions in Open Client™ or with the tsequal function):

create table testing 
    (c1 int, timestamp datetime)




Copyright © 2005. Sybase Inc. All rights reserved. Date and time datatypes

View this book as PDF