Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with ON UPDATE CURRENT_TIMESTAMP

Status
Not open for further replies.

SamBones

Programmer
Aug 8, 2002
3,186
US
It's supposed to be possible to put a "[tt]DEFAULT CURRENT_TIMESTAMP[/tt]" and/or "[tt]ON UPDATE CURRENT_TIMESTAMP[/tt]" clause on a [tt]TIMESTAMP[/tt] or [tt]DATETIME[/tt] column when creating a table. I'm getting an error on the "[tt]ON UPDATE[/tt]". Is this not possible with MS SQL Server?

Code:
CREATE TABLE testTbl (
	id		INT,
	txt		VARCHAR(100),
	ts		TIMESTAMP	DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
	);

Code:
Msg 156, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'ON'.

I'm an Oracle guy adrift in a SQL Server world.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top