简体   繁体   English

将列从其当前的varchar数据类型更改为date和datetime数据类型

[英]change columns from their current varchar datatype to date and datetime datatype

Hi Guys I still have not got answer to this problem. 嗨,大家好,我仍然没有答案。 I have 100 colums in a table which are varchar datatype. 我的表中有100个列是varchar数据类型。 I want to change them from varchar datatype to datedatatype. 我想将它们从varchar数据类型更改为datedatatype。 these colums are datefield colums say [Vax hover delivery actual date]. 这些列是datefield列,例如[Vax悬停交付实际日期]。 so how can I change them from their current varchar datatype to date and datetime datatype. 因此,如何将它们从当前的varchar数据类型更改为date和datetime数据类型。 I will appreciate. 我会感激的 thanks 谢谢

  1. Insert your current column values in a temp table. 将您当前的列值插入到临时表中。
  2. Drop column from table. 从表中删除列。
  3. Recreate a column on table with date type with nullablity. 在具有无效性的日期类型的表上重新创建一列。
  4. Update new column on table with values in the temp table. 用临时表中的值更新表上的新列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM