- Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 不能将显式值插入时间戳列。请对列列表使用 INSERT 来排除时间戳列,或将 DEFAULT 插入时间戳列

kettle同步数据,从mysql到sqlServer中,MySQL中的时间字段为timestamp类型,sqlserver中的数据列数据类型为timestamp类型,但是二者同步的时候会发生错误,报错:

image

然后试图将sqlServer中的timestamp字段类型修改为datatime类型,执行语句:

Alter table HDP_cluster_status_info Alter Column check_time datetime;

又报错:

image

Cannot alter column check_time because it is 'timestamp'。。。


sqlServer中不能对已有的timestamp字段修改为datatime类型,视图查找该问题的解决方法:

连接:https://ask.sqlservercentral.com/questions/34952/how-to-change-timestamp-datatype.html

image

好吧,这哥们说不能转,没办法,只能将该字段删了重新添加上了,不过好在,该表中没有数据

如果表中有数据的情况下,那就需要将该表进行备份之后,再查询进行写入了

原文地址:https://www.cnblogs.com/Gxiaobai/p/12876867.html