Table of Contents

Create table from source

Copies the schema of an existing table or view to a new table in the same SQL Server database. Data is not copied — only the table structure (columns, types, and optionally keys and indexes).

Use this to create staging, backup, or snapshot tables that match a source schema without manual column definitions.

When to use this

  • To create a staging table that mirrors a production table's schema before loading data into it.
  • To set up empty archive or snapshot tables with the same structure as the source, so data can be inserted later.
  • To replicate a table schema across databases when combined with a dynamic connection.

How it works

  • Input: A source table (or view) name and a target table name, both on the same connection.
  • Processing: Reads the schema of the source table and creates the target table with matching columns and types. Optionally copies the primary key, foreign keys, and indexes. If Replace existing table is checked and the target already exists, the existing table is dropped and recreated. If unchecked and the target exists, the action raises an error.
  • Output: No return value. The target table is created as a side effect.
Warning

When Replace existing table is checked, the existing target table and all its data are dropped before the new table is created. This is irreversible.

Create table from source action showing the node with source table and target table outputs, and the property panel with Source table set to Test_Transaction and Target table set to MyNewTable

Example Example
This flow runs a full staging cycle. Create Orders_Staging from Orders clones the schema from Orders to Orders_Staging with Replace existing table checked, so the staging table is recreated on every run. Insert Rows loads data into the staging table. Merge Tables merges the staged rows into production, and Delete Table drops the staging table afterward. Use this pattern when the staging table must match the source schema exactly and be rebuilt on each execution.


Properties

Name Required Description
Title No A descriptive title for the action.
Connection Yes The SQL Server Connection to the database containing the source table.
Enable dynamic connection No When enabled, uses a connection created at runtime by Create Connection. Use this when the target database varies between runs.
Source table Yes The name of the existing table or view whose schema to copy. You can select from the table picker or enter a name manually.
Target table Yes The name of the new table to create.
Replace existing table No When checked, drops the target table if it already exists and recreates it. When unchecked, the action raises an error if the target table exists. Checked by default.
Copy primary key No When checked, copies the primary key constraint from the source table to the target.
Copy foreign key(s) No When checked, copies foreign key constraints from the source table to the target.
Copy index(es) No When checked, copies indexes from the source table to the target.
Command timeout (seconds) No Maximum execution time in seconds. The action fails with a timeout error if exceeded. Default is 120 seconds.
Disabled No When checked, the action is skipped during Flow execution.
Description No Additional notes or comments about the action or configuration.

Returns

No return value. The action creates the target table as a side effect.

See also


SQL Server: Videos / Getting started

This section contains videos to help you get started quickly working with Azure SQL / SQL Server using Flow.


Dump CSV file from Azure Blob container to Azure SQL table

This video demonstrates how to import all records from a CSV file into an Azure SQL table.
In the demo, no data import options (such as data type conversion, number or date formatting) are specified, meaning the data is imported as raw text.