Home > Archive > SQL Anywhere database > April 2005 > Changing a Default TimeStamp field to a DateTime field









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing a Default TimeStamp field to a DateTime field
Kumar

2005-04-22, 8:23 pm

I want to change a column from being a "Default TimeStamp" to just a
DateTime field type.

It was orig. added like this:
alter table messages add SentDateTime DateTime Default TimeStamp

I tried this:
Alter Table Messages Modify SentDateTime DateTime

But it still is behaving as a default timestamp (the column is updated when
any other column is changed)

Any advice appreciated.
-k-


Kumar

2005-04-22, 8:23 pm

sorry, v9.02/current build

"Kumar" <ddsnospam@maui.net> wrote in message
news:42696299$1@foru
ms-2-dub...
>I want to change a column from being a "Default TimeStamp" to just a
>DateTime field type.



Erik Anderson

2005-04-22, 8:23 pm

Try something like

alter table messages modify SentDateTime default NULL

note that "default timestamp" means to update the field on every update
"default current timestamp" means to populate the field when the row is
created but leave it alone for updates

"Kumar" <ddsnospam@maui.net> wrote in message
news:42696299$1@foru
ms-2-dub...
>I want to change a column from being a "Default TimeStamp" to just a
>DateTime field type.
>
> It was orig. added like this:
> alter table messages add SentDateTime DateTime Default TimeStamp
>
> I tried this:
> Alter Table Messages Modify SentDateTime DateTime
>
> But it still is behaving as a default timestamp (the column is updated
> when any other column is changed)
>
> Any advice appreciated.
> -k-
>
>



Kumar

2005-04-22, 8:23 pm

thanks!

"Erik Anderson" < erikba@teamworkgroup
.com> wrote in message
news:42698b94$1@foru
ms-1-dub...
> Try something like
>
> alter table messages modify SentDateTime default NULL



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com