Migrating table from SQL server to Snowflake

Hello everyone,

As you can read from the title, I am wondering how I can migrate a table from SQL Server to Snowflake.

Here's what I did:

  1. Read from the SQL table.
  2. Push data into a Retool table.
  3. Insert into a Snowflake table from the Retool table

The original table contains 7 fields, and I want the new table to contain an 8th field that should be the date of insertion.

So my query to Insert into Snowflake was something like:

Insert into table xxxx
values ({{table1.data.field1}}, {{table1.data.field2}},...,{{table1.data.field7}}, current_date())

Of course, that didn't work.


Hey there :wave: For step 3 are you looking to add a record to a Snowflake resource? Here is a simple example of what that could look like:

1 Like

Hi Lauren,

Thanks a lot for the reply.

I tried, but it didn't work, as the data seems not to be in the correct format to be entered in Snowflake.

In the end, I did something like this:

  1. Import data from SQL and display on Retool table
  2. Via a loop enter all the data displayed on Retool table on Snowflake table. However this was done by running:

Insert into table abc
Values (xxx, xxx, xxx, xxx)

Via a loop, this was executed multiple times on its own (once it's done for index 0, it moves to index 1, and so forth until there's no more data to insert).

The reason I'm not giving too many details on my method is that it's not efficient, even though it is working fine. It is inserting row by row, which is taking way too much time.

Unfortunately I tried bulk insert into Snowflake,but the SQL data seems to be in JSON format. :confused: