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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTER table

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
What is the syntax for the ALTER TABLE command to change a columns data type in a table from a 'timestamp' to a 'datetime'?

Thanks,
-bitwise
 
alter table xxx alter column .... Ion Filipski
1c.bmp


filipski@excite.com
 
Yeah, I've tried that it says:

"Cannot alter column 'Field_Name' because it is 'timestamp'."

What does that mean? Why doesn't it allow you to change the timestamp type?

-bitwise

PS: Here is the statement:
alter table Table_Name alter column Field_Name datetime
 
true enough, not supported....

you could however add a new column for the timestamp field and then drop the timestamp column.... this would work. if you needed the column to be the same name, you could then rename the column to the proper name after adding it as something else.

remember a timestamp column does not have an actual time in it. just a system generated number, so the values in it are irrellevant. Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top