Problems displaying this newsletter? View online.
Database Weekly
The Complete Weekly Roundup of SQL Server News by SQLServerCentral.com
Hand-picked content to sharpen your professional edge
Editorial
 

Malleable Source Control

Git has proved to be a better fit to the needs and workflow of a database development team than anything that came before. Git is valuable because it encourages branching and merging, giving more choice in the way that your team can work. Due to the ease with which you can adapt Git, there is no obvious best approach to using Git with SQL Server databases. So much depends on the way that the team works best, the nature of the database, and of the applications that use it.

The biggest problem with databases, I've found, is working out what is the 'source'. With procedural code there is nothing to debate, it is simple. You can't 'migrate' an application. You build it from source. With databases, it all gets tricky. For a start we don't major on doing builds. For a decade or so, none of us have done an offline release where we built a production server from source on every release and then imported the production data. Instead, we migrate it from the existing version to the new release whilst preserving its data. We certainly have some code in databases that looks very much like conventional procedural source. Modules or routines, by which I mean code-based objects such as procedures, views, functions, triggers and so on, fall easily into that category. Under the covers, such code gets replaced even if the object containing the code is only modified. Not so with tables, constraints, relationships and indexes. The source of a table isn't maintained as metadata, though it can be represented or generated in script-form in a rich variety of ways that all generate the same database object. In other words, a table can be represented by several different sorts of scripts that all look different; you've lost the one-to-one correspondence between the script and the created object. This makes source control, which works out what changed by comparing scripts, trickier because you can get 'false positives' just by using a different way of generating a script. To add to the head-scratching, how do we deal with data? Obviously, only the enumerations can go into source control but where do you draw the line?

Fine, you might say, a migrations approach is surely better because it reflects the natural way of developing, where you are generally altering database objects. Your comments aren't trashed, and your code builds the database, migration by migration. True, but you tend lose the narrative at the object level, when you need answers to the questions 'who changed what in this table, when and why?'. You also need to rebuild from scratch occasionally, to make sure that there are no uncontrolled changes. If your databases always migrate, all sorts of anomalies such as disabled constraints can creep into the picture and can get into the canonical source if you are careless in the way you consolidate excessive migrations.

I suspect that there will always be diverse techniques for source control in the database, because of the enormous differences in their size, nature and requirements. We will, I suspect, make best progress in refining database development techniques with tools that encourage diverse ways of working, such as Git.

 

Phil Factor

Join the debate, and respond to the editorial on the forums

 
The Weekly News
All the headlines and interesting SQL Server information that we've collected over the past week, and sometimes even a few repeats if we think they fit.
Vendors/3rd Party Products

Automating Migrations for Multiple Databases using Flyway

During development you need a fast, automated way to build multiple copies of a database on any development or test server, with each database at the right version. This article provides a PowerShell automation script for Flyway that will do the job.

Batch Processing using Flyway

How to create a batch file that executes any number of database migration tasks across a range of servers and databases, using Flyway.

Code Review & DevOps

A frequent question among those learning about DevOps is "How do we do code reviews in this automated process?". Grant Fritchey shares three options - and a word of caution - to ensure you can appropriately understand the changes happening in your system

Administration of SQL Server

SET NOCOUNT For SQL Server

Last week I was reviewing an article and found myself needing information on the use of NOCOUNT as a standard...

Extended Events: Avoid the XML

From Scary DBA (Grant Fritchey)

One story I hear over and over goes like this: I t...

Zeroing out a transaction log file does not use zeroes

From Born SQL

I’ve been doing SQLskills training recently, and Paul Randal (blog | Twitter) reminded our class that zeroing out a transaction log file does not use zeroes (0x00). Well, not...

SQL Agent Jobs – When Success is Failure

From SQLServerCentral Blogs

Have you ever run across an issue that made you take a step back and scratch your head? Recently, I had this exact situation hit my Inbox. One of... The...

Reasoning about Indexed View Locking

From Forrest Shares Stuff

Edit: Paul has pointed out some significant gaps, so I will be reworking this post in the future. Locks are accurate for this particular scenario, but apparently there are...

Basics of SQL Server Transaction Log

From SQL Server – {coding}Sight

Total: 1 Average: 5 What is a Transaction Log? There is a requirement in relational database systems that transactions must be durable. This is “D” in the ACID properties...

Quick Scan Report – High VLF Count – Video Tip

From Steve Stedman

Virtual Log Files (VLFs) are part of the SQL Server log file. When space is allocated in the log due to growth, that new chunk of log is broken...

Career Growth and Certifications

6 Non-Coding Tech Jobs to Consider

From IT Pro - Microsoft Windows Information, Solutions, Tools

The ability to code is always a plus, but there ar...

Community Interests

The SQL Saturday Foundation Board of Directors

From SQLServerCentral Blogs

I’m pleased to announce that I have selected an ...

Computing in the Cloud (Azure, Google, AWS)

Keeping track of Azure resources with tags – Part 3

This is now the third post in a series on Azure tags...

Conferences, Classes, Events, and Webinars

Innovate Today with Azure SQL

Join Microsoft's Rohan Kumar, and a full team of Azure SQL experts, for Innovate Today with Azure SQL. This free digital event from Microsoft lets you choose the sessions and technical demos that are most interesting to you and focus on the capabilities and possibilities that you want to learn more about.

Compliant Database DevOps

In this demo webinar, discover how Redgate's end-to-end Compliant Database DevOps framework enables your organization to Standardize, Automate, Monitor & Protect it's databases.

Database Design, Theory and Development

Oracle sequences: The basics

From Simple Talk

Oracle sequences can be used to create artificial ...

SQL Server BIT Data Type – An Ultimate Guide

From SQL Server – {coding}Sight

Total: 1 Average: 5 Introduction to Bit Data type The data type represents an attribute that stores integer, character, data time, binary data. Suppose you have a web application...

DevOps and Continuous Delivery (CI/CD)

Why GitOps Model Is the Future of DevOps

From IT Pro - Microsoft Windows Information, Solutions, Tools

DevOps brings operations and development closer together, but with GitOps that whole process can be accelerated.

MDX/DAX

Greater than, Greater than or equal to, Less than, Less than or equal to - DAX Guide

The “greater than” operator returns TRUE when the first argument is greater than the second argument.

Performance Tuning SQL Server

Query times just keep fallin’!

So if I can’t modify or add indexes and I can’t change code, how do I get my query times to drop?..

Detecting Cache Pressure With sp_PressureDetector

From Erik Darling Data

Cache Rules The post Detecting Cache Pressure With...

How Parallel Plans Start Up – Part 1

From SQLPerformance.com

Paul White takes a deep dive into the way parallel...

PowerPivot/PowerQuery/PowerBI

Optimising The Performance Of Combining Data From Multiple Parquet Files In Power Query/Power BI

From Chris Webb's BI Blog

In all the testing I’ve done recently with impor...

What Makes Microsoft's Power BI a Leader in the Gartner Magic Quadrant?

From BlueGranite Blog

With Microsoft once again ranked as a Leader in th...

Drill-through from Power BI to Paginated Report – Report Recipe #4

From Paul Turley's SQL Server BI Blog

Navigation between reports is the hallmark of an interactive reporting solution, enabling the ability to drill-through and see relevant details and contextual filtered information in a target report. Power...

Why is Power BI SLOW

From Guy in a Cube

We've seen people comment that Power BI is SLOW. B...

Product Reviews and Articles

Book Review: Query Store for SQL Server 2019

This book aims to use Query Store to improve your SQL Server queries, how does it fare?

Professional Development

Daily Coping 30 Mar 2021

From SQLServerCentral Blogs

I started to add a daily coping tip to the SQLServ...

SQL Server Security and Auditing

What is Transparent Data Encryption?

From SQLServerCentral Blogs

In this post we look at Transparent Data Encryptio...

T-SQL

Issues When Using Temporary Tables in Nested Stored Procedures

SQL Server offers a lot of flexibility when working with objects like stored procedures and temporary tables...

9 Best Practices for Writing SQL Queries

From SQL Server – {coding}Sight

If you are reading this article, most probably, you are already familiar with SQL. You know how to write basic SQL queries...

Basic Fetch and Offset Experiments–#SQLNewBlogger

From SQLServerCentral Blogs

I’ve never used the FETCH or OFFSET commands for...

Generate a Random Number for Each Row in a Query {a better way}

From SQL Undercover

A couple of years ago I wrote a post on how to generate a random number in SQL Server. https://sqlundercover.com/2017/06/22/generating-random-numbers-for-each-row-over-a-specified-range-and-other-funky-stuff-you-can-do-with-them/ It’s ok and it works, it’s also a method...

Building a SQL Server data dictionary

From Simple Talk

In this article, Edward Pollack explains the benefits of a SQL Server data dictionary and how to build one.… The post Building a SQL Server data dictionary appeared first on...

 
RSS FeedTwitter
This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. This newsletter was sent to you because you signed up at SQLServerCentral.com. Note: This is not the SQLServerCentral.com daily newsletter list, and unsubscribing to this newsletter will not stop you receiving the SQL Server Central daily newsletters. If you want to be removed from that list, you can follow the instructions on the daily newsletter.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
[email protected]

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -