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

Data Sovereignty in the Cloud

I remember the court case years ago when the US government wanted to access data in Azure that was physically stored in Ireland. I wrote lightly about this and linked to the article back in 2020. This has typically been more of a concern for the EU (and other countries) than the US, but I'm sure there are organizations in the US that use the cloud and don't want their data accessed by other countries' governments.

Recently, a Microsoft executive was asked about this in the French Senate. The Microsoft response was that they  (Microsoft) cannot guarantee data sovereignty for French customers. If the US government served a warrant under the Cloud Act, a US corporation would have to turn over the data.

While the Internet is fantastic in many ways, especially the ability to communicate and collaborate with others all around the world, we still have physical countries and governments. The rules, regulations, and more vary across different countries, but apparently, those rules aren't going to be enforced if the company doing business is based in the US.

This might be good for the US, but not for customers in other countries. In my mind, it's somewhat amazing that many other countries haven't had organizations build clouds that work inside their borders. I'm especially surprised the EU hasn't subsidized or assisted a company in growing as a cloud provider, though likely any organization that grew to a significant size was purchased by Amazon, Google, or Microsoft.

This access apparently hasn't happened to date, at least not in a way that is disclosed publicly. Proponents point out that this access would only be allowed with some level of evidence of a crime and a probable cause to access the data in question. That might be true, but we know from the past that a lot of government access to information is kept secret from public disclosure.

The longer I work with data, the more I find that few organizations truly care about data privacy and protection. They give lip service, and despite employees sometimes wanting to treat data with care, profit (or other) motivations often override other considerations. I've mostly given up on worrying about strong data protections and accepted a significant amount of my data is likely being used by more organizations than I'd like.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

What is Delayed Durability in SQL Server — And Should You Turn It On?

Chandan Shukla from SQLServerCentral

Learn about delayed durability in SQL Server and how it might help you with a heavily loaded server.

External Article

DevOps vs. SRE: Bridging the Gap, Not Building Walls

Additional Articles from SimpleTalk

In Part 2, we shift focus from theory to practice. We will explore how organizations can harmoniously integrate both practi: the agility of DevOps and the resilience of SRE. During integration, it requires deliberate changes to culture, tooling, metrics, and collaboration patterns.

Blog Post

From the SQL Server Central Blogs - PASS Data Community Summit LinkedIn Contest

K. Brian Kelley from Databases – Infrastructure – Security

If you're not having success in convincing your organization to send you to this year's PASS Data Community Summit, you could win a 3-day registration by submitting some basic...

Blog Post

From the SQL Server Central Blogs - DevUp 2025 Recap

DataOnWheels from DataOnWheels

Had an incredible time at DevUp in St. Louis this weekend! This conference gets better and better each year and draws in some incredible folks from all over the...

The Phoenix Project

The Phoenix Project

Additional Articles from SQLServerCentral

In this newly updated and expanded edition of the bestselling The Phoenix Project, co-author Gene Kim includes a new afterword and a deeper delve into the Three Ways as described in The DevOps Handbook.

 

 Question of the Day

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

 

Which MAXDOP?

I have a SQL Server 2022 instance with this setting:
EXECUTE sp_configure 'max degree of parallelism', 4;
GO
I then run this:
SELECT ProductID, OrderQty, SUM(LineTotal) AS Total
FROM Sales.SalesOrderDetail
WHERE UnitPrice < $5.00
GROUP BY ProductID, OrderQty
ORDER BY ProductID, OrderQty
OPTION (MAXDOP 2);
GO
What is the maxdop for my query?

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)

Detecting Multiple Changes

I want to write a trigger to detect changes to columns in SQL Server 2022. I have this table:

CREATE TABLE CustomerLarge
  (CustomerID               INT NOT NULL IDENTITY(1, 1) CONSTRAINT CustomerLargePK PRIMARY KEY CLUSTERED
 , CustomerName             VARCHAR(20)
 , CustomerContactFirstName VARCHAR(40)
 , CustomerContactLastName  VARCHAR(40)
 , Address                  VARCHAR(20)
 , Address2                 VARCHAR(20)
 , City                     VARCHAR(20)
 , CountryCode              CHAR(3)
 , Postal                   VARCHAR(20)
 , creditlimit              INT
 , discount                 NUMERIC(4, 2)
 , lastorderdate            DATETIME
 , lastorderamount          NUMERIC(10, 2)
 , lastordercontact         VARCHAR(20)
 , created                  DATETIME
 , modified                 DATETIME
 , modifiedby               VARCHAR(20)
 , statusid                 INT
 , active                   BIT
 , customersize             INT
 , primarysalesid           INT);
GO

I want to determine if both the CustomerContactFirstName and CustomerContactLastName fields are changed, but no others. What is the mask I need to use with COLUMNS_UPDATED()?

Answer: IF (SUBSTRING(COLUMNS_UPDATED (),1,1) & 12) = 12

Explanation: In testing, I found I needed to use the SUBSTRING) function or the bitwise math doesn't work. In this case, to check two columns, I need both bitmasks to be set. These are the 3rd and 4th columns, so the 4 and 8 places in binary. Adding these together gives me 12 and I need an exact match. A > 12 means other columns were updated as well. Ref: COLUMNS_UPDATED() - https://learn.microsoft.com/en-us/sql/t-sql/functions/columns-updated-transact-sql?view=sql-server-ver16

Discuss this question and answer on the forums

 

Featured Script

Cleanup backup file folder future 7 days

Srinivas Merugu from SQLServerCentral

Two PowerShell scripts to create backup folders and clean up old files.

--Powershell script

--- Backup folder future 7 days

# Get date after 7 days in yyyyMMdd format
$futureDate = (Get-Date).AddDays(7).ToString("yyyyMMdd")

# Build folder path
$folderPath = "D:AdhochBackupsUntil$futureDate"

# Print to verify
Write-Output "Creating folder: $folderPath"

# Create the folder if it doesn't exist
if (-not (Test-Path $folderPath)) {
New-Item -ItemType Directory -Path $folderPath | Out-Null
Write-Output "Folder created successfully."
}
else {
Write-Output "Folder already exists."
}

------Cleanup folder

$today = Get-Date -Format "yyyyMMdd"
$path = "D:AdhochBackupsUntil$today"
if (Test-Path $path) {
Remove-Item -Path $path -Recurse -Force
}

--- Backup folder future 7 days

# Get date after 7 days in yyyyMMdd format
$futureDate = (Get-Date).AddDays(7).ToString("yyyyMMdd")

# Build folder path
$folderPath = "D:AdhochBackupsUntil$futureDate"

# Print to verify
Write-Output "Creating folder: $folderPath"

# Create the folder if it doesn't exist
if (-not (Test-Path $folderPath)) {
New-Item -ItemType Directory -Path $folderPath | Out-Null
Write-Output "Folder created successfully."
}
else {
Write-Output "Folder already exists."
}

------Cleanup folder

$today = Get-Date -Format "yyyyMMdd"
$path = "D:AdhochBackupsUntil$today"
if (Test-Path $path) {
Remove-Item -Path $path -Recurse -Force
}

More »

 

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 2019 - Administration
Best Practices when a TempDB Drive is full? - Good morning. I've recently started a new SR. DBA position.  I have been hit with a lot of things in this last month. I recently found a server that had the TempDB drive full.  I wanted to resize the files to take up only 80% of the drive and leave 20% for the OS processing.  […]
RCSI vs. tempdb placement for mixed OLTP + heavy afternoon reporting (SQL 2019) - We upgraded an application and are seeing performance issues. The vendor suggests enabling READ_COMMITTED_SNAPSHOT (RCSI) to “improve performance.” Symptoms: performance degrades in the afternoon when there’s more reporting/querying against the production database. Reports are data heavy. We don’t yet have a separate reporting server, but that’s likely coming. Questions: If we move tempdb to its […]
SQL Server 2019 - Development
need to find rows in a table based upon a type field BUT stop when a select type - i have a table account number, date, type, amount 0000001, 20250815, P, 200.00 0000001, 20250810, C, -125.00 0000001, 20250801, C, -75.00 0000001, 20250725, C, -125.00 0000001, 20250720, P, 175.00 ...... i need the query to stop when it finds the first P type after the first one. so i would get 0000001, 20250815, P, 200.00 […]
Reporting Services
2 table designs within one section to keep data for one section value within one - My requirement is to display data for  a number of routes within 2 tables and keep everything in one page where each value for the route generates a new page. I have created a group for route calling it 'sectie1'  and set proper behavior for this sectie (page break, having headers on each page etc). […]
Editorials
Why Tech Events Matter for Data Pros (and why I’m grateful) - Comments posted to this topic are about the item Why Tech Events Matter for Data Pros (and why I’m grateful)
Your Favorite Improvement - Comments posted to this topic are about the item Your Favorite Improvement
T-SQL
Backup information incorrect after AAG toggle - Good morning all, I have the attached T-SQL query that has been working well for sometime. This past Saturday during patching, the AAG toggled from primary on server1 to primary on server2. Now the query does not report differentials from the current primary server. Any pointer/suggestions on what I fail to see is greatly appreciated. […]
Backup information incorrect after AAG toggle - Good morning all, I have the attached T-SQL query that has been working well for sometime. This past Saturday during patching, the AAG toggled from primary on server1 to primary on server2. Now the query does not report differentials from the current primary server. Any pointer/suggestions on what I fail to see is greatly appreciated. […]
Article Discussions by Author
Using psycopg2 to Connect Python to PostgreSQL - Comments posted to this topic are about the item Using psycopg2 to Connect Python to PostgreSQL
From Rows to Pages: The Hidden Chaos Behind SQL Server’s Sampling Methods - Comments posted to this topic are about the item From Rows to Pages: The Hidden Chaos Behind SQL Server’s Sampling Methods
SQL Server 2022 - Development
ssms aborting in object explorer details - Hi i just set up a new pc after my touch pad went bad.  our tech guy installed a version of ssms that says its this  SQL Server Management Studio 21.4.12+5.36408.4.  its not the version i used before.   I'm not 100% certain what image he uses to set up a new pc. I'm getting the […]
How to Resolve SQL Server Error 9100? - Is there any professional method to resolve SQL server error 9100.
how does report builder play with dev ops - Hi as i prepare for using source control, it occurs to me report builder is the most common way we edit and save reports to ssrs.   Is there a hook into dev ops from report builder when  a developer prefers RB for ssrs modification?   or will we need to get vs involved also after the […]
having the right GIT (or whatever) for when i clone repos from devops - Hi, i'm getting set up to begin using dev ops for source control over lots of dev types of objects including ssis, db objects etc etc. My understanding is that if i want to use that familiar gui experience where after you clone a repo and want to just click (instead of issuing git commands […]
thought i installed ssis extension in vs2022 but got sql server database project - Hi I dont think i'm crazy.   I had to get a new pc.   And reinstalling vs extensions unfortunately became my dreaded nightmare once again.  I went to extensions in vs, manage extensions,  chose sql server integration services project 2022, followed all the prompts , restarted the pc and saw what you see below.   i'm back […]
 

 

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

 

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