SQL Source Control

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

Working with migration scripts

What are migration scripts?

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

Migration scripts are 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 only need to write SQL for the data changes in the migration script. Schema changes are committed separately and deployed as normal.

To learn more, see Migration script examples.

Deploying migration scripts

SQL Compare 11 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 have the opportunity to review the deployment script 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 recommend linking your production database directly to source control.

Dependencies

When you create a migration script that includes uncommitted schema changes, SQL Source Control automatically includes any dependencies. Deselecting any of these dependencies during the deployment stage will 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 documentation).
    3. Run the comparison.
    4. Open the Deployment Wizard and deploy the version.
      For full instructions, see Deploying data sources (SQL Compare documentation).
时间: 2024-10-13 01:17:24

SQL Source Control的相关文章

Red Gate - SQL Source Control实现对SQL SERVER 的源代码控制

原文地址:http://bbs.csdn.net/topics/350165431 SQL Server 一直没有一款很好的源码控制器,之前自己曾尝试自己写一个,将所有的 脚本 自动生成到某一目录下,然后将该目录提交到SVN中,进行管理,但是由于 有些存储过程中的 引号太多,没能把脚本完整的导出,最后只好搁浅 了. 昨天在逛国外论坛时 ,遇到了一款很强大的工具. 只有 20多天的使用期限,我在国外没找到 序列号,在国内发现没有研究这个工具的Programer. 所以分享给大家,一起来研究下. 我

edit filter rules in sql source control

https://documentation.red-gate.com/soc6/common-tasks/exclude-objects-using-filters 如果有人上传了filter,name需要在sql source control的Get Latest的选项卡中pull from remote repository(也可以后台,在git版本库中直接pull). 然后勾选filter,再apply changes

How To Use Git Source Control with Xcode in iOS 7

Note from Ray: Tutorial Team member Felipe Laso Marsetti has ported this tutorial to iOS 7 as part of the iOS 7 feast. We hope you enjoy! Whether you're a solo developer or working on a team, if you're not using source control for your projects, you

退役笔记一#MySQL = lambda sql : sql + ' Source Code 4 Explain Plan '

Mysql 查询执行过程 大致分为4个阶段吧: 语法分析(sql_parse.cc<词法分析, 语法分析, 语义检查 >) >>sql_resolver.cc # JOIN.prepare 生成逻辑查询plan(sql_optimizer.cc) >># JOIN.optimize 生成物理查询plan(sql_planner.cc) run the explain plan(sql_executor.cc) 退役笔记一#MySQL = lambda sql : sql

小白也能用Git管理团队项目了:百度云同步+Git Extensions+Git Source Control Provider

百度云同步 百度云同步,会将本地的某个文件目录和云端进行同步.如果在本地将这个同步的目录设置为Git的中心服务器,那么本地push到中心服务器的内容也会被同步到云端.其他开发者只要也进行相同的设置,就能够进行合作开发. 下面使用一个远程和本机来模拟两个开发者,先是安装云同步. Git远程仓库命令 新建中心服务器 先在同步目录中创建一个MyTest的项目文件夹. 然后使用“git init --bare”来建立中心仓库,中心仓库会自动同步到云端.到这里一个空的中心服务器就建好了. clone一个仓

PL/SQL Transaction Control

PL/SQL 基础 ( 下 ) 1. PL/SQL中的 SQL语句 - END语句与COMMIT等内容,没有任何关系. - PL/SQL does not directly support data definition language( DDL ) statements, such as CREATE TA BLE, ALTER TABLE, or DROP TABLE. - PL/SQL does not support data control language( DCL ) state

【Visual Studio】The project appears to be under source control, but the associated source control plug-in is not installed on this computer

[问题描述]用 Visual Studio 2013打开一个项目时,出现下面错误: [问题原因]参考 http://codeverge.com/asp.net.web-forms/the-project-appears-to-be-under-source-cont/434113 出现上面错误的原因是,项目使用了 VSS 或 TFS 或 SVN 等版本控制工具,而本机没有安装对应的工具. 如果使用了 VSS 或 TFS,那么工程所在的文件夹下会有 .vssscc 文件: 如果使用了SVN,那么工

项目管理实践【六】自动同步数据库【Using Visual Studio with Source Control System to synchronize database automatically】

在上一篇项目管理实践[五]自动编译和发布网站中,我们讲解了如何使用MSBuild+Robocopy+WebDeployment来自动编译和部署网站,今天,我们来看一下,如何使用MSBuild +SVN来自动同步数据库. 首先,将我们项目中的数据库文件和数据库日志文件放到某个目录下,这里放到StartKitDB目录下,然后在该目录下新建一个名为StartKitDB的文本文件,修改扩展名为proj,实际上,在理论上任何扩展名都可以,然后,使用记事本或其他程序打开文件,将下面的内容复制到其中,保存.

项目管理实践【五】自动编译和发布网站【Using Visual Studio with Source Control System to build and publish website automatically】

在上一篇教程项目管理实践[三]每日构建[Daily Build Using CruiseControl.NET and MSBuild] 中,我们讲解了如何使用CCNET+MSBuild来自动编译项目,今天我们讲解一下怎么使用MSBuild+WebDeployment+Robocopy自动编译过和部署ASP.NET网站. 首先安装下面的三个软件: 1.MSBuild.Community.Tasks下载:http://msbuildtasks.tigris.org/files/documents/