About EasyMorph Tutorials & Examples Web-help

Import a full database schema

Hello everyone,

Just to ask you how can I do to import a complete schema from a database and then export it into snowflake

If you need to recreate tables, fields, field types, indexes, constraints etc. I would suggest following a relevant Snowflake migration guide: https://resources.snowflake.com/migration-guides.

If you only need to move data into an already created schema in Snowflake then:

  1. Create and ODBC connection to Snowflake, choose “Other SQL” dialect (Snowflake SQL dialect will be supported starting from version 4.6)
  2. Create a list of tables by querying the database metadata table
  3. Iterate across the list:
    3.1) Import using the “Import from database” with a custom SQL query, such as SELECT * FROM {TableName} where parameter {TableName} is a table name from the list assigned in the iteration
    3.2) Export into a CSV file
    3.3) (Optionally) Upload the CSV file into a cloud storage supported by Snowflake
    3.4) Use the “Database command” action, command “Custom SQL” to run a bulk upload SQL statement in Snowflake to import the CSV file into Snowflake.
To learn more about EasyMorph visit easymorph.com.