Working with scripts folders【SQL Compare】

Working with scripts folders

A scripts folder is a set of object creation scripts representing a database's schema and (optionally) data.

An object creation script file is created for each object, and different object types are stored within subfolders you can specify.

You can use scripts folders:

  • for version control of databases

    For example, you may want to store the script files in a source control system, so that you can track the modified or new objects.

  • to compare databases on unconnected SQL Servers

You can create and compare scripts folders only if you are using SQL Compare Professional Edition.

Creating a scripts folder

To create a new scripts folder, on the File menu, select Create scripts folder.

Alternatively, on the Project Configuration dialog box, select SQL Source Control as one of the data sources, then select Scripts folder, and then click Create:

The Create new scripts folder dialog box is displayed:

Under Data source details, specify the details of the source for the scripts folder. You can create a scripts folder from a database, backup, snapshot, or another scripts folder.

Under Scripts folder properties, specify a name and location for the scripts folder.

SQL Compare automatically detects the case sensitivity of the data source. If you want to override this, clear the Auto detect case sensitivity check box, and select the Treat items as case sensitive check box if required.

By default, SQL Compare decrypts text objects in databases that were created using the WITH ENCRYPTION option. When comparing large databases, selecting this option can result in slower performance.

 

  • When the source is a snapshot, the case sensitivity and decryption options are not available.
  • When the source is a scripts folder, the decryption option is not available.
  • When the source is a SQL Change Automation project, the decryption option is not available.

 

Comparing and deploying scripts folders

You can:

  • compare a scripts folder with another data source

    See: Setting data sources.

  • deploy a scripts folder

When a scripts folder is the target, you can either:

  • Create a deployment script to update the database from which the scripts folder was created, or
  • Update files in the scripts folder directly
When an object is dropped during deployment, its script file is not deleted.

If a scripts folder is the target, and any of the script files that will be modified are designated as read-only, a warning is displayed. If you click Yes to continue, these files will be made writable so that they can be modified. This may occur, for example, when you are working with a source control system that sets files to read-only status in some situations.

For more information, see: Using the Deploying wizard.

More information about scripts folders

This section provides further information about using object creation scripts as a data source in SQL Compare.

  • White space

    SQL Server does not always process white space and comments correctly at the beginning and end of the object definition for some objects such as views, stored procedures, and rules. You are therefore recommended to select the Ignore White Space option when you use a scripts folder as a data source.

  • Numbered stored procedures

    Numbered stored procedures are not supported for scripts folders.

  • CLR assemblies

    SQL Compare can compare object creation scripts that contain CLR assemblies, or include paths to assembly files. When deploying to a scripts folder, SQL Compare will use the hexadecimal content of the assembly.

  • Certificates, symmetric keys, and asymmetric keys

    These are not supported when you use a scripts folder as a data source.

  • Comments

    When you select a scripts folder as the target data source, SQL Compare preserves comments in object types such as views and stored procedures. However, this is not possible for non-textual object types such as tables. Comments that are part of a table definition will be lost when the table is modified and the object creation script updated.

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(261)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示