18 December 2018
18 December 2018

SQL Source Control v7 Enhancements

With the v7 release, SQL Source Control now enforces Git hooks, and provides full support for working with Git repositories hosted on Azure DevOps. It also comes with pre- and post-deployment scripts to make it easier to automate the build and deploy new database versions to your pre-production or production servers.

Finally, the latest release continues SQL Source Control’s long-standing commitment to keep pace with SSMS improvements, with support for the public preview of SSMS 18.

Better Git Support

Source control is the fundamental tool that enables team collaboration during development. It allows each developer to share changes quickly, see a revision history of all changes, revert to a previous revision, and to enforce standard source control policies and checks. Git has long been the most widely-used of the source control systems that SQL Source Control supports.

SQL Source Control plugs directly into SQL Server Management Studio (SSMS) and provides database developers with an efficient interface between their local, working copy of the database, in SSMS and their local and remote source control repositories.

When working with Git, each developer works on their own sandbox database, committing tested changes to their local Git repository, and then sharing them with others by pushing changes to the remote team repository, as well updating their own work frequently by pulling down and merging the changes made by others.

SQL Source Control v7 fixes the previous authentication problems that meant that users previously had to leave SSMS and use a Git tool, or the Git command line, in order to push to or pull from a Git repository hosted on Azure DevOps (previously called TFS/VSTS).

In addition, SQL Source Control now supports Git Hooks, which allow users to specify scripts that git will call before or after running certain git commands (such as a commit, or a push). The hooks allow the team to enforce compliance with their own policies and rules. For example, some users set up hooks to require that each commit has an associated comment, or a story or bug ID

SQL Source Control v7 now enforces these hooks (previous version ignored them). You will need Git for Windows installed on the machine that has SQL Source Control. If it’s not installed, you will be notified when linking new databases or trying to Commit/Get Latest/View History on databases already linked to Git.

Pre- and post-deployment scripts

The primary purpose of SQL Source Control is to make it as easy as possible to get a database under version control, and then commit and share all subsequent changes. However, it also assists with the various database build and deployment processes that the source control system must support, such as rebuilding a database in any pre-production environment, at any version, or deploying version ‘x’ to version ‘x+1’ or rolling back to a previous version.

SQL Source Control v7 now supports pre- and post-deployment scripts that give you additional flexibility when you are automating your database deployments. You can use them to set up database level settings like configuration settings or creating filegroups. You can also use the built-in SQL Server variable @@SERVERNAME to customize where the scripts run and have different SQL statements for different environments. This can be useful for managing permissions and adding different users into roles in different environments or handling data that is different across the environments.

In previous versions, users had to manage their own scripts and orchestrate this via their release management system, which took more time to set up. Now, you can do everything right in SQL Source Control and it will be picked up in manual deployments with SQL Compare or automated deployments with SQL Change Automation. There are some great examples about using Pre and Post deployment scripts in theĀ documentation.

Upgrading to SQL Source Control v7

For existing SQL Source Control users, you will find v7 when Checking for Updates in the SQL Source Control Help menu within SSMS. For new users, you can get SQL Source Control from the Product page. We hope you enjoy SQL Source Control v7; please visit our forum to post any feedback or requests.

Share this post.

Share on FacebookShare on Google+Share on LinkedInTweet about this on Twitter

You may also like

  • Article

    Automating Builds from Source Control for the WideWorldImporters Database

    Sample databases from Microsoft are like YouTube stars: they’re quirky, popular with their fans, and always online somewhere. It makes them a common choice when it comes to creating prototypes, but their lovable quirkiness sometimes makes this tricky. Here, we’ll be prototyping an automated database build from source control, for the WideWorldImporters database. Microsoft uses

  • Article

    A strategy for implementing database source control

    Much has been written on the benefits of having a database under source control though many articles are clear on “why” but conspicuously vague on “how”. Prior to our organization’s decision to embrace Linux and other open-source technologies, one of our development teams had notable success using Redgate SQL Source Control for a data mart

  • Article

    SQL Source Control v6 now supports SQL Server 2017, SQL Graph, and TFS 2018

    SQL Server 2017 went on general release a couple of weeks ago and the latest version of SQL Source Control offers full support, as well as support forĀ Team Foundation Server (TFS) 2018. This brings a whole host of benefits and opens up cross-platform workflows, encompassing both on-premises and cloud, through connections to SQL Server instances

  • Article

    Source controlling database users

    How should you source control database users? This topic came up a couple of times recently. Once at the inaugural Redgate database source control training day and once or twice at SQL Saturday Exeter when, somewhere in between the foot jenga, pirate hats, and explosive Phil Factor unmasking (if you believe it?), I found some

  • University

    Take the SQL Source Control course

    This course takes you from installation all the way up to getting the most out of the advanced operations in SQL Source Control to help you set the foundations for CI/CD. Learn how to link a development database to your source control system, commit changes into a repository, produce a data deployment script, and more.

    Once you complete this course, move on to learn how you can automate your database deployments from source control in our SQL Change Automation with SQL Source Control projects course.

  • Forums

    SQL Source Control Forum

    Connect your databases to your source control system