Splitting a table
Last modified: March 28, 2025
If you split a table into two tables in a database schema, it involves creating a new table and removing columns from the original table. However, the deployment will lead to data loss of the dropped table.
Solution: To prevent data loss, you need to create a migration script to copy the data from the original table to the new table before you delete columns from the original table. The process involves the following steps:
- Create a new table
- Generate a migration script to copy data to the new table and execute it
- Drop the column from the original table
Note
The comparison engine of the tools doesn’t handle all cases automatically, which is why the cases mentioned above must be resolved manually.
The screenshot displays the Schema Comparison document and the scripts generated by Schema Compare Engine and a migration script, which should be created manually to perform errorless data migration.
The table provides source and target table script examples to illustrate the case:
Source table script example | Target table script example |
---|---|
|
|
The table provides examples of scripts generated by the Schema Comparison engine and those that should be generated manually for errorless data migration to illustrate the case:
Script generated by the Schema Comparison engine | Script that should be generated manually for errorless data migration |
---|---|
|
|
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by Schema Compare for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.