How to set up SQL Source Control. The short guide for evaluators

Similar documents
Introducing Xcode Source Control

Setting up a local working copy with SVN, MAMP and rsync. Agentic

OLAP Cube Manual deployment and Error resolution with limited licenses and Config keys

Installing Windows Server Update Services (WSUS) on Windows Server 2012 R2 Essentials

Technical Support Set-up Procedure

GETTING STARTED WITH SQL SERVER

Spector 360 Deployment Guide. Version 7

Source Control Guide: Git

Setting up your new Live Server Account

Unity Version Control

Print Audit 6 Network Installation Guide

Migrating helpdesk to a new server

Version Control! Scenarios, Working with Git!

Windows Server Update Services 3.0 SP2 Step By Step Guide

How to Configure Outlook 2003 to connect to Exchange 2010

TortoiseGIT / GIT Tutorial: Hosting a dedicated server with auto commit periodically on Windows 7 and Windows 8

COOK COUNTY OFFICE 365 MIGRATION USER GUIDE

Installing LearningBay Enterprise Part 2

Adding Outlook to a Blackberry, Downloading, Installing and Configuring Blackberry Desktop Manager

Introduction to Source Control ---

SQL Server 2005: Report Builder

Installing and configuring Microsoft Reporting Services

Moving the TRITON Reporting Databases

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Google Drive: Access and organize your files

Moving the Web Security Log Database

System Area Management Software Tool Tip: Integrating into NetIQ AppManager

Jenkins on Windows with StreamBase

USING OUTLOOK WITH ENTERGROUP. Microsoft Outlook

Web based training for field technicians can be arranged by calling These Documents are required for a successful install:

How to make the s you Send from Outlook 2010 appear to Originate from different Addresses

SENDING S & MESSAGES TO GROUPS

DEPLOYING A VISUAL BASIC.NET APPLICATION

Outlook Web App (OWA) To create a new message:

FileMaker 13. ODBC and JDBC Guide

Installing Cobra 4.7

NetWrix SQL Server Change Reporter. Quick Start Guide

SOFTWARE INSTALLATION INSTRUCTIONS CLIENT/SERVER EDITION AND WEB COMPONENT VERSION 10

MultiClient Software Quick Guide

PCLinq2 Hi-Speed USB Bridge-Network Cable. Quick Network Setup Guide

Outlook XP Only

QUANTIFY INSTALLATION GUIDE

Business mail 1 MS OUTLOOK CONFIGURATION... 2

Understanding offline files

Step-By-Step Guide to Deploying Lync Server 2010 Enterprise Edition

Team Foundation Server 2010, Visual Studio Ultimate 2010, Team Build 2010, & Lab Management Beta 2 Installation Guide

SalonTouch SQL and.net Database Backup Instructions Updated 10/16/2006

KEYWORDS InteractX, database, SQL Server, SQL Server Express, backup, maintenance.

Version Control with Subversion and Xcode

Automating client deployment

NetWrix SQL Server Change Reporter

Secure Messaging Server Console... 2

FileMaker 12. ODBC and JDBC Guide

Reporting works by connecting reporting tools directly to the database and retrieving stored information from the database.

Specify the location of an HTML control stored in the application repository. See Using the XPath search method, page 2.

Staying Organized with the Outlook Journal

Work. MATLAB Source Control Using Git

Installation Manual Version 8.5 (w/sql Server 2005)

Print Audit 6 Client Only Installation Guide

Setting Up Exchange. In this chapter, you do the following tasks in the order listed:

Visual Studio.NET Database Projects

User Guide. Version 3.2. Copyright Snow Software AB. All rights reserved.

The basic steps involved in installing FLEETMATE Enterprise Edition and preparing it for initial use are as follows:

SQL Server Replication Guide

Backup and Restore the HPOM for Windows 8.16 Management Server

Getting Started with Telerik Data Access. Contents

On premise upgrade guide (to 3.3) XperiDo for Microsoft Dynamics CRM

Backup / migration of a Coffalyser.Net database

Xythos on Demand Quick Start Guide For Xythos Drive

Chapter 28: Expanding Web Studio

USING MS OUTLOOK. Microsoft Outlook

Sophos Cloud Migration Tool Help. Product version: 1.0

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

SourceAnywhere Service Configurator can be launched from Start -> All Programs -> Dynamsoft SourceAnywhere Server.

An Introduction to K12 s Online School (OLS)

This manual will also describe how to get Photo Supreme SQLServer up and running with an existing instance of SQLServer.

USING MS OUTLOOK WITH FUS

NetIQ. How to guides: AppManager v7.04 Initial Setup for a trial. Haf Saba Attachmate NetIQ. Prepared by. Haf Saba. Senior Technical Consultant

Deploying System Center 2012 R2 Configuration Manager

PROJECTIONS SUITE. Database Setup Utility (and Prerequisites) Installation and General Instructions. v0.9 draft prepared by David Weinstein

How To Set Up Dataprotect

How to Configure a Remote Desktop Licensing Server for vspace 6

Automated backup. of the LumaSoft Gas database

Administrator s Guide to deploying Engagement across multiple computers in a network using Microsoft Active Directory

Dynamics CRM for Outlook Basics

Mail in Outlook Web App

GETTING STARTED GUIDE 4.5. FileAudit VERSION.

Table of Contents SQL Server Option

FocusOPEN Deployment & Configuration Guide

Lab 5 Using Remote Worklight Server

How to make the s you Send with Outlook and Exchange Appear to Originate from Different Addresses

Microsoft Corporation. Project Server 2010 Installation Guide

Updating Device Firmware Via FTP

Adding the BU IMAP Inbox 1. Along the left side of the screen, there is a Mail column. Look for the All Mail Folders section.

Junk Settings. Options

Office of Information Technology Connecting to Microsoft Exchange User Guide

In the same spirit, our QuickBooks 2008 Software Installation Guide has been completely revised as well.

System Center 2012 R2 SP1 Configuration Manager & Microsoft Intune

Entourage - an Introduction to

Transcription:

How to set up SQL Source Control The short guide for evaluators

Content Introduction Team Foundation Server & Subversion setup Git setup Setup without a source control system Making your first commit Committing a change Getting a change Setting SQL Source Control options Next steps 3 4 9 12 13 15 17 18 19 2

Introduction SQL Source Control links your database to your source control system, so you can share changes to schemas and reference data, check a history of database development, and roll back anything you don t want to keep, without leaving SQL Server Management Studio. If you don t have the installer for SQL Source Control, you can download it from our website. This 19-page guide shows you how to set up and use SQL Source Control with your database and Team Foundation Server, Subversion, or Git, as well as how to get started if you don t have a source control system. It covers how to: 1. Link your database to source control 2. Make an initial commit 3. Commit a change 4. Get a change 5. Set SQL Source Control options and share them with your team If you already own SQL Source Control and need help getting set up, visit our documentation site to learn how to link your database to your source control system and how to use SQL Source Control. 3

Team Foundation Server & Subversion setup The next few pages show you how to set up SQL Source Control with Team Foundation Server (TFS) or Subversion (SVN). If you re using Git, you can safely skip ahead to page 9, where the setup instructions for Git begin. If you don t have a source control system, skip to page 12, where the setup instructions for our evaluation repository begin. For more information on setting up SQL Source Control with SVN or TFS, visit: Linking to source control with TFS Linking to source control with SVN Linking a database to source control To get started, you need to link your database to your source control repository. If you don t want to try SQL Source Control with one of your own databases yet, you can create a dummy database full of objects using this script. In SQL Server Management Studio s Object Explorer, select the database you want to link to source control. 4

In SQL Source Control, on the Setup tab, make sure Link to my source control system is selected and click Next: Linking your database to source control in the Setup tab On the Choose your source control system page, select Team Foundation Server (TFS) or Subversion (SVN) and click Next. The Link to source control dialog box opens. 5

Specifying URLs for Team Foundation Server If you re using Subversion, skip ahead to the next page. The Link to source control dialog box, set up for Team Foundation Server For TFS, specify the URL of your Team Foundation Server in the Server URL field. If you use a non-standard port, specify this in the URL (eg http://myurl:8080/tfs). In the Database folder field, enter the folder in TFS where SQL Source Control will store SQL scripts. If you re the first person to link the database to source control, specify an empty folder. If someone has already linked this database to source control, specify the folder they used. For instructions on how to add migrations scripts, skip to the end of the next page. 6

Specifying a URL for Subversion The Link to source control dialog box, set up for Subversion For SVN, use the Database repository URL field to specify a folder in your Subversion repository where SQL Source Control will save SQL scripts. For example: http://subversion.example.com/databases/adventureworks If you re the first person to link the database to source control, specify an empty folder. If someone has already linked this database to source control, specify the folder they used. How to add migration scripts If you want to use migration scripts customizable change scripts that SQL Compare uses during deployment then under Migration scripts repository URL, specify an existing, empty folder in the repository. The folder can t be in the database folder. For example, you can use Repository folder\migration scripts, but not Repository folder\database folder\migration scripts. 7

Shared or Dedicated database development model? When you link a database, you tell SQL Source Control which development model your team uses. SQL Source Control changes its behavior slightly to suit the model your team uses. If each developer has their own database, leave the Development model set to Dedicated database, the default setting. If you re linking to a database that will be used by multiple developers, make sure Shared database is selected. Ready to go? Once you ve provided repository details, click Link. The database icon in the Object Explorer changes to indicate that your database is linked to source control: A database that s been linked to source control in the Object Explorer To see how to start committing your changes, move to page 13. 8

Git setup The next few pages show you how to set up SQL Source Control with Git. If you ve already set up SQL Source Control with TFS or SVN, you can safely skip ahead to page 13, where instructions for committing changes begin. If you don t have a source control system, skip to page 12, where the setup instructions for our evaluation repository begin. For more information on setting up SQL Source Control with Git, visit Linking to source control with Git. Linking a database to source control To get started, you need to link your database to your source control repository. If you don t want to try SQL Source Control with one of your own databases yet, you can create a dummy database full of objects using this script. In SQL Server Management Studio s Object Explorer, select the database you want to link to source control. 9

In SQL Source Control, on the Setup tab, make sure Link to my source control system is selected and click Next: Linking your database to source control in the Setup tab On the Choose your source control system page, select Git and click Next. The Link to Git page opens: The Link to Git page in SQL Source Control 10

In the Folder field, specify a folder in an existing local Git repository where SQL Source Control will save SQL scripts, for example: C:\Repository\DatabaseFolder If you re the first person to link the database to source control, specify an empty folder. If someone has already linked this database to source control, specify the folder they used. Ready to go? Once you ve provided repository details, click Link. The database icon in the Object Explorer changes to indicate that your database is linked to source control: A database that s been linked to source control in the Object Explorer To see how to start committing your changes, move to page 13. 11

Setup without a source control system If you don t have a source control system to link to, we recommend you use our evaluation repository. In SQL Server Management Studio s Object Explorer, select the database you want to link to source control. In the SQL Source Control Setup tab, select Just let me try it out and click Next. This opens the Link to an evaluation repository page. Click Next. In the Select an open evaluation repository page, make sure Create a new evaluation repository is selected and click Link. Using the built-in evaluation repository to try out SQL Source Control 12

This creates a local Subversion repository on your computer. You don t have to set anything up yourself. We don t recommend you use it as a long-term source control system, however, as the evaluation repository doesn t work well for keeping backups or sharing changes. When you finish evaluating, you should link to your own source control system. For more information, see Linking to the evaluation repository in the SQL Source Control documentation. Making your first commit Once you ve linked your database to source control, you re ready to make your first commit (also known as the initial commit). This gets a copy of your database into source control. To make the initial commit, go to the Commit changes tab. This tab lists database changes that haven t been committed to source control yet: Committing database objects to source control for the first time in the Commit changes tab 13

You may have some types of object you never want to commit to source control, for example, objects of a certain type (eg functions or views), or objects that belong to a particular schema. You can create a filter to exclude these objects so they never appear in the Commit changes or Get latest tabs. To create a filter, right-click on the grid and select Edit filter rules. Editing filter rules in the Commit changes tab For more information, see Using filters to exclude objects in the SQL Source Control documentation. To commit your database objects to source control, make sure all the objects are selected, write a commit message (eg Initial commit ), and click Commit. Pushing changes to a Git remote repository To get changes into your remote repository, you need to push after you ve committed them. To do this, find the blue banner above the commit grid and click Push. This pushes all commits from the local repository to the remote repository. Making a Git push in the Commit changes tab 14

Committing a change Try making a simple change to the database, such as adding a column to a table. After you make the change, go to the Commit changes tab. The change appears in the list of changes to commit: See which changes you haven t yet committed to source control, with line-by-line diffs, in the Commit changes tab In the lower pane, you can see the differences between the SQL creation scripts for the new object and for the object in source control. To commit the change, write a commit message and click Commit. Commit messages are useful when getting changes or reviewing history, so your team can quickly understand what s in each change and why it was made. 15

Pushing changes to a Git remote repository To get changes into your remote repository, you need to push after you ve committed them. To do this, find the blue banner above the commit grid and click Push. This pushes all commits from the local repository to the remote repository. Making a Git push in the Commit changes tab 16

Getting a change Let s check out the database from source control. Link an empty database to the same repository you linked your database to. Afterwards, when you go to the Get latest tab, you ll see your database changes waiting to be retrieved from source control: Getting database changes in the Get latest tab When you click Get latest, the new database will be updated to match the other database. Pulling changes from a Git remote repository To get the latest changes from source control, you need to pull changes from the remote repository. 1. On the Get latest tab, click Pull from remote repository. Any changes from the remote repository are pulled to your local repository. 2. Click Apply changes to database. The changes from the local repository are deployed to the database. 17

Setting SQL Source Control options You can configure SQL Source Control to suit your development process: Using filters to exclude objects Change how SQL Source Control deploys database changes Link static data to source control Sharing option changes with your team When you edit an option, it appears in the Commit changes tab as a change to commit: Sharing a SQL Source Control option with your team, in the Commit changes tab After you commit, other people on your team can get your change to the options in the Get latest tab. This makes sure everyone works with the same options. 18

Next steps Nice work now you ve covered all the basics of SQL Source Control. So what next? If your team is on board with the idea of database source control, then it s just a case of setting everyone up. But most teams want to do some extra investigation to be sure they re making a good investment. To help your team decide, we ve put together a guide full of free articles, ebooks, and videos, so you can: Show your DBA how source control keeps production data safe Help anyone who hasn t used source control before to learn the fundamentals Explain the advantages that database source control brings to a business: o Time and money savings o Strong regulatory compliance o Fast, reliable delivery of new products to customers Download How to make the case for SQL Source Control in 5 steps Or, we can show your team exactly how it would work in your environment. Our technical team is more than happy to talk about your needs, and we can arrange custom demos for you on change management, productivity, or anything else you re interested in. To speak to someone on our team email SQLSourceControlQuestions@red-gate.com 19