Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Acting with Confidence

Recently, I saw a graph about making decisions that showed the impact of both reversibility and consequences. Here is an example of such a graph and how one might approach decisions. If things are easily reversible or have a low consequence, we tend to make a decision and move on. Or we are willing to make a decision. One of the examples of such a decision was choosing what to wear out to dinner. It's easy to change, and (in general) of little consequence. Choosing to send a large amount of money to someone through Venmo (or some other mechanism), can be hard to reverse and have substantial consequences.

This made me think of some of the DBA and developer decisions I've made in the past. When we work with databases, the changes we make can have a large impact and be quite consequential to our organization. Downtime, data quality, etc. could all impact revenue, profit, reputation, or even future prospects of survival. That can be a lot of pressure when you are deciding to refactor a data model or adjust a lot of data during a deployment.

We might think we can rollback or undo changes, but often we would end up applying reversing transactions. If I change a data type, the data is changed ( assuming the DML completes). To change back, I can't roll back outside of a restore. I would change the type back and have an equally large and long transaction run. Having HA or replication technologies in the mix can dramatically impact the scope of both the initial and reversing transactions.

How confident must you be in your actions before you undertake something of consequence? Do you require an easy rollback, or are you willing to act even if the rollback is painful?

Maybe a better question is how do you appraise the consequence of an action? Is it the application/database or perhaps the data? You might consider all the dependencies from other applications or pipelines on this. I know many DBAs worry about the performance impact of changes that can slow or stop other work. I constantly see people asking if Flyway can estimate how long a change will take, especially when dev/test environments are a poor representation of production sizes, scales, and workloads.

If you have a 2GB database, you might just make changes. A restore is quick, and I've often found greenfield applications taking this approach since the data sizes are small and even consequential actions can be undone with a restore operation. Many of the "code-first" technologies work great in these situations, but once we have multiple application dependencies and large data sets, restores can be non-trivial or even unacceptable ways to deal with issues.

The image linked above talks about gathering data and analyzing, which sounds like the prudent thing to do, but this can be easier to say than do in practice. Deciding what analysis to undertake and how long to spend on it are the real tricks. Those are the judgment calls that only experienced humans can make. While AI might help, this is an area I really want capable humans with the final say.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
SQLServerCentral Article

Creating a Simple and Flexible Random Password Generator in SQL Server

john.martin from SQLServerCentral

Generating temporary passwords is a common requirement in many applications. Users may need to reset a forgotten password, new accounts may require an initial password, or developers may generate test credentials. While password generation is often implemented in application code, doing it directly in SQL Server provides clear advantages. It centralizes the logic, ensures consistency […]

SQLServerCentral Article

SQL Art, Part 3: Happy Easter Fun in SSMS

Terry Jago from SQLServerCentral

More spatial fun, this time for Easter.

External Article

DevOps anti-patterns: what they are and how to avoid them

Additional Articles from SimpleTalk

In software development, DevOps promises faster delivery, increased collaboration, and more reliable deployments. However, many teams unknowingly fall into anti-patterns.

Blog Post

From the SQL Server Central Blogs - Finding Balance: Things Will Come Up

Steve Jones - SSC Editor from The Voice of the DBA

I have a presentation on finding balance in your career that got quite a few people thinking and commenting on their own experiences. I decided to write a few...

Blog Post

From the SQL Server Central Blogs - Who Are You Doing It For?

K. Brian Kelley from Databases – Infrastructure – Security

But as I've matured over the years, I came to realize that I needed to ask a critical question, "Who am I doing this for?" When I agree to...

Storytelling with Data: Let's Practice!

Site Owners from SQLServerCentral

Influence action through data! This is not a book. It is a one-of-a-kind immersive learning experience through which you can become—or teach others to be—a powerful data storyteller.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Identities and Sequences IV

When thinking about the identity property and sequence objects, which of these can be used with numeric and decimal data types?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Using OPENJSON

I have some data in a table that looks like this:

BeerID BeerName    brewer               beerdescription
1      Becks       Interbrew            Beck's is a German-style pilsner beer 
2      Fat Tire    New Belgium          Toasty malt, gentle sweetness, flash of fresh hop bitterness.
3      Mac n Jacks Mac & Jack's Brewery This beer erupts with a floral, hoppy taste
4      Alaskan Amber Alaskan Brewing     Alaskan Brewing Amber Ale is an "alt" style beer
8      Kirin       Kirin Brewing         Kirin Ichiban is a Lager-type beer

If I run this, what is returned?

select t1.key
    from openjson((select t.* FROM Beer AS t for json path)) t1

Answer: A list of the key values (0-4)

Explanation: Key is seen as a reserved word in this context and an error is returned. If "key" is in quote or brackets, this returns 0-4. Ref: Reserved Keywords - https://learn.microsoft.com/en-us/sql/t-sql/language-elements/reserved-keywords-transact-sql?view=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2016 - Administration
How to change the FDLaunch Error log file location - The file FDLAUNCHERRORLOG gets created in the default \MSSQL\Log folder. So far, I've found absolutely no way to change that location. The link to a MS URL in a similar posted question here on SSC is Forbidden. I asked our in-house AI, and it told me about the "SQL Server Fallback Database feature". I think […]
SQL Server 2019 - Administration
CMS server query & temp tables - I am annoyed. We have a CMS server that has hundreds of servers saved to the "node." I need to query them all at once to get a COUNT of a certain value. I want a total across all the servers, not the total on each server. But because CMS keeps throwing Server Name as […]
Editorials
Barely Reviewed Code - Comments posted to this topic are about the item Barely Reviewed Code
This Week's AI Trust Problem Became Everyone’s Problem - Comments posted to this topic are about the item This Week's AI Trust Problem Became Everyone’s Problem
Article Discussions by Author
The day-to-day pressures of a DBA team, and how we can work smarter with automation and AI - Comments posted to this topic are about the item The day-to-day pressures of a DBA team, and how we can work smarter with automation and AI, which is is not currently available on the site.
Using OPENJSON - Comments posted to this topic are about the item Using OPENJSON
Data Modeling with dbt for Visual Code: The Fabric Modern Data Platform - Comments posted to this topic are about the item Data Modeling with dbt for Visual Code: The Fabric Modern Data Platform
Data Modeling with dbt for Visual Code: The Fabric Modern Data Platform - Comments posted to this topic are about the item Data Modeling with dbt for Visual Code: The Fabric Modern Data Platform
The Problem Isn't Always Your Query or Schema... Sometimes It's Hidden Assumptions - Comments posted to this topic are about the item The Problem Isn't Always Your Query or Schema... Sometimes It's Hidden Assumptions
Identity Defaults - Comments posted to this topic are about the item Identity Defaults
Migrate SSRS Reports to PowerBI Report Server in SQL Server 2025 - Comments posted to this topic are about the item Migrate SSRS Reports to PowerBI Report Server in SQL Server 2025
Identities and Sequences III - Comments posted to this topic are about the item Identities and Sequences III
SQL Server 2022 - Administration
SQL 2017 to SQL 2025. Good to Go ? - We need to replace our Windows server running SQL 2017. Any reason not to go to SQL 2025 ?  Any "gotchas" migrating databases from SQL 2017 to SQL 2025 ?
SQL Server 2022 - Development
Daily aggregation of Azure Blob Storage by tier (created/tier-change/deleted) - Hello all, I’m looking for advice on how to derive a daily snapshot table from a large fact table in SQL Server that tracks Azure Blob Storage metadata. In production this table can have tens of millions of rows, and its structure cannot be changed. To make the problem reproducible, I’ve created the simplified version […]
what data type i should use for roversion col and can i use less than greater - can i use Rowversioncol ( in my database it's synonyme timestamp is used) to run the following query to find all inseted after this @LastKnownRowVersion; SELECT * FROM YourTable WHERE RowVersionCol > @LastKnownRowVersion; data type i should use for @LastKnownRowVersion; why i am asking is because i read this from "A nonnullable rowversion column is […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

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