A Practical Approach to Version Control for SQL Server Steve Jones SQLServerCentral Redgate Software
Goals Store database code in version control Track code changes across time Branch and merge changes to database code
Get in touch Steve Jones
Free Tool Database Lifecycle Management
What is version control? …any kind of practice that tracks and provides control over changes to source code. Software developers sometimes use revision control software to maintain documentation and configuration files as well as source code. (Wikipedia) Source Control = Version Control = Revision Control
Use version control because neither you nor your developers are perfect.
Getting Started Create a location in a VCS respository Script out objects to.sql files Commit files
Workflow Check out or open a file Make changes (and test) Save and Commit
Demo – Setup in Git
Benefits Communication and collaboration History Undo Get back to previous versions Branching/merging Single version of the truth Building block for ALM
Demo – Changes, Migrations, and History
Teamwork Work should be logically separated Sandboxes should to be used Developers’ work should not conflict But sometimes we work on shared databases, and …
Everyone Wants Locking
Demo – Locking Objects and Conflicts
Branching
Example of branching and merging #SQLintheCityUK #SQLintheCityUS
Branches can be dangerous
#SQLintheCityUK #SQLintheCityUS Demo – Branching and merging
Finally Use a VCS, keep control of your code Ensure everyone has the tools Ensure everyone understands the process Write comments for the future you
Goals Store database code in version control Track code changes across time Branch and merge changes to database code
Want to try the tools you’ve just seen? Visit the Redgate Booth #SQLintheCityUK #SQLintheCityUS Fill in your evaluations