SQL Source Control

Source: Internet
Author: User
Tags management studio sql server management sql server management studio

Https://documentation.red-gate.com/display/SOC5/SQL+Source+Control+5+documentation

Working with migration scriptswhat is migration scripts?

To deploy changes from version control, the SQL Compare engine generates a deployment script. This was based on the differences between the state in version control and the target database. Migration scripts in version control can define what the SQL Compare engine generates specific sections of this deployment Script.

Migration scripts is necessary to avoid data loss when making certain schema changes. To achieve this, the migration script intervenes to make data changes occur at the right point of the deployment.

In most cases, you are need to write SQL for the data changes in the migration script. Schema changes is committed separately and deployed as normal.

To learn more, see migration script examples.

Deploying Migration Scripts

SQL Compare One or later can generate deployment scripts with migrations using the following source/target types:

Source:

    • Scripts folder
    • Source Control

Target:

    • Live Database
    • Scripts folder

We recommend using SQL Compare to deploy changes to production, as you had the opportunity to review the deployment scrip T before it ' s deployed. For a full walkthrough of the deployment process using SQL Compare, see Migration script examples.

It is possible to use the Get latest function in SQL Source Control to deploy these changes, however we don ' t rec Ommend linking your production database directly to source control.

Dependencies

When you create a migration script the includes uncommitted schema changes, SQL Source Control automatically includes any Dependencies. Deselecting any of these dependencies during the deployment stage would cause the deployment to fail.

Static data

Migration scripts do not work with static data. See Static data and migrations.

Deploy a database from source control

To deploy a database from source control to a server, use SQL Compare Pro, or the SQL Server Management Studio integration Pack add-in.

Deploying with SQL Compare

To deploy with SQL Compare:

      1. Open SQL Compare.
      2. Select a version from source control.
        For full instructions, "Selecting a version from source control" on the Setting Data sources page (SQL Compare Documentati ON).
      3. Run the comparison.
      4. Open the Deployment Wizard and deploy the version.
        For full instructions, see Deploying Data Sources (SQL Compare documentation).

SQL Source Control

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.