I'm having trouble creating a column in a table with the following query:
alter table Items
add ModifiedTime timestamp not null
default current_timestamp on update current_timestamp;
I get this error:
Msg 156, Level 15, State 1, Line 13
Incorrect syntax near the keyword 'on'.
I don't know why, I have tried different ways to write the query but cannot get the "ON UPDATE" part to work.
Also I tried just adding the column using this query:
alter table Items
add ModifiedTime timestamp not null
default current_timestamp
And that query works, but the value showing in column ModifiedTime
is totally wrong, its saying: 0x0000000000002713
. I have no idea why its saying that either..
I'm using Microsoft SQL Server 2014 Management Studio, and the SQL Server is SQL Server Express 64bit , version 12.0.2000.8 if that helps anything