有没有办法将日期时间值(getdate()
)插入/更新到如下创建的临时表中:
select id, null as testdate
into #temp_table
然后是稍后的声明:
update #temp_table
set testdate=getdate()
我收到错误:
cannot convert datetime into int...
谢谢。
最佳答案
将选择中的列转换到
select id, cast(null as datetime) as testdate
into #temp_table
关于sql - 选择 null 作为 testdate 进入 #temp_table,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3711626/