gpt4 book ai didi

sql - 选择 null 作为 testdate 进入 #temp_table

转载 作者:行者123 更新时间:2023-12-02 10:53:09 25 4
gpt4 key购买 nike

有没有办法将日期时间值(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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com