Search
 
SCRIPT & CODE EXAMPLE
 

SQL

snowflake alter column data type

alter table t1 alter c4 set data type varchar(50)
Comment

change column type snowflake

alter table TABLE_NAME add column TEMP_COLUMN TIMESTAMP_LTZ(9);

update TABLE_NAME t1
  set t1.TEMP_COLUMN = TO_TIMESTAMP_LTZ(t2.TIMESTAMP_NTZ_COLUMN_NAME)
  from TABLE_NAME t2
  where t1.TEMP_COLUMN = t2.TIMESTAMP_NTZ_COLUMN_NAME

// if you don't want troubles create a new copy of table and use SWAP WITH instead
alter table aws_config rename column TIMESTAMP_NTZ_COLUMN_NAME to TIMESTAMP_NTZ_COLUMN_NAME_OLD;
alter table aws_config rename column TEMP_COLUMN to TIMESTAMP_NTZ_COLUMN_NAME;

alter table aws_config drop column TIMESTAMP_NTZ_COLUMN_NAME_OLD
Comment

PREVIOUS NEXT
Code Example
Sql :: drop procedure sql 
Sql :: sql get user account 
Sql :: convert float to int sql 
Sql :: oracle sql two left digits 
Sql :: pop sql insert value into 
Sql :: mysql on terminal mac 
Sql :: setVal pgsql 
Sql :: bigquery get current date 
Sql :: copy sql table 
Sql :: oracle list index on table 
Sql :: duplicate column values sql 
Sql :: show all table name mysql 
Sql :: mysql find non alphanumeric characters 
Sql :: integer limit sql create table 
Sql :: list index mysql cli 
Sql :: mysql case when null 
Sql :: convert series number to date in sql 
Sql :: how to install sqlite3 python 
Sql :: start mysql server using docker 
Sql :: oracle list service names 
Sql :: drop table if exists 
Sql :: how to add not null constraint in sql 
Sql :: group_concat order by 
Sql :: backup mysql data only 
Sql :: psql: FATAL: Ident authentication failed for user "postgres" 
Sql :: postgres in operator with comma separated values 
Sql :: t sql check column exists 
Sql :: mysql parse int 
Sql :: minus vs intersect in sql 
Sql :: update with join sql server 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =