Introduction
In this article, we will demonstrate how to generate a CREATE TABLE script from source metadata in SSIS (SQL Server Integration Services). This tutorial focuses on using a source component to read data and the ZappySys Upsert Destination component to automatically generate a CREATE TABLE script based on the metadata from the source.
By using the ZappySys SSIS PowerPack, you can automate the process of creating table structures dynamically from the source data, which is helpful for ETL workflows where the schema needs to be inferred or managed automatically.
Prerequisites
- Download and install the ZappySys SSIS PowerPack.
- Access to a SQL database.
Steps
Step 1: Configure the source component
-
In the Control Flow, drag a Data Flow Task into the workspace, then double-click it.
-
Drag a source component from the SSIS Toolbox into the Data Flow workspace. In this example, we will use the ZappySys JSON Source component.
-
Double-click the JSON Source to configure it.
-
Select the fourth example from the component and uncheck the option to include parents.
-
Preview the data and press OK to save the configuration.
Step 2: Use the Upsert Destination to generate a CREATE TABLE script
-
Drag the Upsert Destination component from the SSIS Toolbox and connect it to the JSON Source. Double-click to configure it.
-
In the Target connection field, choose or create a connection to your database. You can use PostgreSQL, AWS Redshift, or a SQL Server connection.
-
In the Target table field, click New, which will instruct the Upsert Destination to automatically generate a CREATE TABLE script based on the metadata from the source. Press OK to generate the new table.
-
After generating the table, continue configuring the component, e.g. set Insert or Update options, and map the source fields to the corresponding columns in the destination.
-
Click OK to save the configuration.
Step 3: Run the package
-
Save and run the SSIS package.
-
The data will be imported and/or updated into the new table in your database.
Conclusion
By using the ZappySys SSIS PowerPack components, such as the Upsert Destination, you can automate the process of generating a CREATE TABLE script directly from source metadata. This approach simplifies the creation of tables for ETL workflows, especially when working with dynamic or changing data sources.
Download and install to start building smarter, faster, and more scalable solutions today! Also don’t forget to visit SSIS PowerPack landing page to explore more connectors, powerful automation features, and real-time data integration tools.
References
- JSON Source
- JSON Source documentation
- Upsert Destination
- Upsert Destination documentation
- Blog articles
- SSIS PowerPack
Contact us
If you encounter any issues or have specific questions, reach out to our support team via live chat or support ticket using our email support@zappysys.com.