簡體   English   中英

選擇null作為testdate進入#temp_table

[英]select null as testdate into #temp_table

有沒有辦法將日期時間值( getdate() )插入/更新到如下所示的臨時表中:

select id, null as testdate
into #temp_table

然后聲明:

update #temp_table 
set testdate=getdate()

我收到錯誤:

無法將datetime轉換為int ...

謝謝。

在select into中插入列

select id, cast(null as datetime) as testdate
into #temp_table

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM