snowflake alter column data type

Solutions on MaxInterview for snowflake alter column data type by the best coders in the world

showing results for - "snowflake alter column data type"
Zylen
11 Aug 2019
1alter table TABLE_NAME add column TEMP_COLUMN TIMESTAMP_LTZ(9);
2
3update TABLE_NAME t1
4  set t1.TEMP_COLUMN = TO_TIMESTAMP_LTZ(t2.TIMESTAMP_NTZ_COLUMN_NAME)
5  from TABLE_NAME t2
6  where t1.TEMP_COLUMN = t2.TIMESTAMP_NTZ_COLUMN_NAME
7
8// if you don't want troubles create a new copy of table and use SWAP WITH instead
9alter table aws_config rename column TIMESTAMP_NTZ_COLUMN_NAME to TIMESTAMP_NTZ_COLUMN_NAME_OLD;
10alter table aws_config rename column TEMP_COLUMN to TIMESTAMP_NTZ_COLUMN_NAME;
11
12alter table aws_config drop column TIMESTAMP_NTZ_COLUMN_NAME_OLD
Luigi
25 Mar 2018
1alter table t1 alter c4 set data type varchar(50)