Development teams are under increasing pressure to keep up with the demand for faster delivery of database changes, while ensuring code quality isn’t compromised.
This pressure comes from both business requirements and industry expectations. The 2021 Accelerate State of Database DevOps report reveals that the number of teams who are elite performers is increasing year-on-year (making up 26% of those in the study) and these teams have more frequent code deployments and a lower change failure rate.
This isn’t helped by the increasing global shortage of full-time developers. In 2021, IDC reported that ‘the shortage of full-time developers will increase from 1.4 million in 2021 to 4.0 million in 2025’.
So how do teams keep pace with business demands, without relying on recruiting extra staff?
This post will outline 4 ways that development teams can elevate their efficiency and code quality to speed up delivery of accurate database changes.
1. Implement coding standards
Coding standards empower teams to work more effectively and collaboratively as everyone’s code is formatted in the same way. A standardized approach to coding not only improves the readability of code – making it easier for teams to understand and collaborate on development work – it also increases the quality by reducing the likelihood of bugs and simplifying peer code reviews.
Adopting coding standards also helps teams to produce secure code. In the UK National Cyber Security Centre’s guidance on secure development and deployment, they advise teams to ‘maintain a consistent coding style’ as inconsistent code makes databases more complex, and that complexity ‘hides bugs, some of which may result in security vulnerabilities’.
While this is all well and good in theory, developers have their own way of writing code, so how do teams get around this to ensure consistency across the code base? New functionality in SQL Prompt, available in SQL Toolbelt Essentials, simplifies the sharing and applying of coding styles.
Developers can share coding styles and snippets with their team from within SQL Prompt using the Redgate Platform (a cloud-hosted service) and then apply them to multiple SQL files in one go with bulk formatting. This allows teams to code in their preferred style and quickly bring their SQL in line with coding standards.
2. Adopt a shift left approach to testing
Shift-left testing is a concept that aims to identify and resolve errors earlier in the development cycle. Testing in the early stages of development improves the quality of releases through the introduction of more rigorous testing, and saves time by catching errors before they have a chance to cause knock-on problems, which are likely to be more challenging to resolve.
In a report titled Quick Answer: What Are the Best Practices to Improve Code Quality, Gartner® recommends that to establish code quality as a top priority for their teams, software engineering leaders should ‘promote the idea that teams test early in the development process to increase opportunities for defect detection and remediation’.
Teams can bake testing into the early stages of development by performing static code analysis and database unit testing as part of a standardized development process.
Static code analysis uses tools to scan code for bugs and ‘code smells’ – flaws in code that can affect performance – as soon as changes are made. These ‘code smells’ include mistakes that are easy to make but hard to detect at first glance, such as code duplication or the use of obsolete elements in the code.
SQL Prompt’s new bulk code analysis capability scans multiple SQL files at once, equipping teams with the ability to easily review code quality as they work. Any issues identified can then be resolved in one go with the bulk auto-fix feature.
Database unit testing also offers a fast, repeatable, and quantifiable way of validating that each individual unit of code is working as intended. SQL Test, included in SQL Toolbelt Essentials, simplifies the introduction of unit testing for the database by allowing teams to write tests in the T-SQL language they’re already familiar with.
3. Version control your database changes
Versioning each database change script, and storing it a version control system, provides teams with a single source of truth to work from and a full change history. By standardizing change management, developers can easily access one another’s work and understand what changes have been made, who made them, why, and when. It also allows team leads to track all database bases, which is crucial when it comes to identifying the source of an errors and satisfying audit requirements.
A 2021 Gartner report, Implement Agile Database Development to Achieve Continuous Delivery states: ‘By managing your database scripts in version control, everything needed to create a running version of the software is stored in a single repository. With only one place to look, it is easy for everyone to find what they need to quickly check out and build the system’.
SQL Toolbelt Essentials gives team access to SQL Source Control which connects databases to version control systems. It plugs into SQL Server Management Studio (SSMS) to allow developers to quickly commit change scripts into version control and make them accessible to the rest of the team.
4. Upgrade your documentation
The 2021 Accelerate State of Database DevOps report reveals that: ‘Teams with good documentation deliver software faster and more reliably than those with poor documentation’. It goes on to state: ‘Any improvement in documentation quality has a positive and direct impact on performance’.
Including clear guidance for writing and maintaining documentation in development processes – and actively encouraging developers to adhere to these guidelines – will help with knowledge sharing across teams and simplify onboarding for new team members.
SQL Toolbelt Essentials includes two tools that help with producing documentation – SQL Doc allows databases to be documented in a few clicks from within SSMS, and SQL Dependency Tracker enables teams to quickly generate diagrams of object dependencies.
Introducing coding standards and database version control encourages development teams to work in a consistent manner. This makes collaboration easier, which in turn has a positive impact on both team productivity and code quality by improving the readability and accessibility of development work. Testing earlier in the development process also helps team to catch and resolve defects in code sooner and reduces the likelihood of compound errors. Finally, upgrading the quality of documentation further elevates efficiency by easing knowledge sharing across teams and the onboarding of new members of staff.
Find out how SQL Toolbelt Essentials, featuring ten tools including exclusive SQL Prompt functionality, supports teams by implementing best practices so they can boost efficiency and increase the frequency and quality of releases.
 Gartner, “Quick Answer: What Are the Best Practices to Improve Code Quality?”, Jim Scheibmeir, Thomas Murphy, et al., May 19, 2021.
 Gartner, “Implement Agile Database Development to Achieve Continuous Delivery”, Lyn Robison, Bill Holz, Oct 30, 2021.
GARTNER is a registered trademark and service mark of Gartner, Inc. and/or its affiliates in the U.S. and internationally and is used herein with permission. All rights reserved.
Was this article helpful?