无法在数据仓库中创建Default DateTime列 [英] Unable to create Default DateTime column in Data warehouse
问题描述
我无法在azure数据仓库表中创建默认的datetime列。我们收到以下错误消息。请帮助我们使用相同的语法或任何替代方案来满足我们的要求。
I am unable to create default datetime column in table of azure data warehouse. we are getting below error message. Please help us to work with same syntax or any alternative for our requirement.
当我们将数据插入使用getdate更新的表[DateTime]列时。
when we insert data into table [DateTime] column updated with getdate.
ALTER TABLE users_behaviors_CustomEvent_Prod
ADD  [DateTime] datetime default(Getdate())
ALTER TABLE users_behaviors_CustomEvent_Prod
ADD [DateTime] datetime default (Getdate())
Msg 104338,Level 16,State 1,Line 193
表达式不能与默认约束一起使用。仅指定默认约束的常量。
提前致谢。
推荐答案
您好Raveendra,
Hi Raveendra,
您无法在Azure DW中将默认约束设置为函数,因此您必须确保将数据插入到您从查询中插入getdate的表时。
You can not set default constraints in the Azure DW to functions, so you will have to make sure when inserting the data into the table that you insert getdate from your query instead.
这篇关于无法在数据仓库中创建Default DateTime列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!