![](/img/trans.png)
[英]Can we add primary key on temp table while doing select * into #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.