且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我怎样才能在merge sql语句中使用cast函数

更新时间:2022-01-30 22:19:22

嗨apsta,

Hi apsta,

似乎您正在尝试CAST目标表的列。这是不可能的。

It seems that you are trying to CAST a column of a target table. It is impossible to do.

恕我直言,你需要CAST分配给列的值,如下所示:

IMHO, you need to CAST the value assigned to the column, like below:

tgt.LastSaleDate = CAST(src.LastSaleDate AS DATETIME2(0))