cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi, Please help me to write a query to insert timestamp value to Sybase table using insert query.

Regards, Bikshu.

View Entire Topic
chris_keating
Product and Topic Expert
Product and Topic Expert

This assumes that you are asking about SQL Anywhere and not ASE. If you are asking about timestamps in ASE, you should ask that in an ASE focused forum.

For SQL Anywhere, here is a simple example:

insert into t (ts_col) values( now() )

For ASE, you should note that a timestamp value is not a data and time value but a binary value generally used for row versioning. Its value is updated anytime a row is modified so that suggests that you likely should not be setting its value at all in a row operation - simply let the server manage that for you. You can obtain the timestamp value with @@dbts. If you are asking in an ASE context, I remind you that I am not an ASE person so you should address this in a forum that is focused on ASE.