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

Testing is Becoming More Important

Many of us know that testing our code is important. The adoption of unit testing by many software application developers as a normal course of business has dramatically improved the quality of applications. Mobile software, especially, has benefited from the requirement for most software to include and constantly run a suite of unit tests.

For database software, I find relatively few organizations formally test their database software. A few people have adopted tSQLt or the Microsoft Unit Testing Framework, but most don't bother. In fact, many queries that are embedded in application code, or built by ORMs, aren't tested beyond a developer looking at the results from their own (limited set of) test data. That often doesn't catch errors until someone in production runs their application against a larger set of data.

What might be worse is that refactoring those queries might produce different results that aren't tested against regressions.

In this new age of AI-assisted coding, testing is becoming more important. Grant wrote an interesting post on LinkedIn that discusses your job changing in the age of AI. You need to have more testing that ensures you validate code that the AI produces, which is going to be more important as the amount of code grows. AI will produce lots more code, and potentially, lots more poor code. We will need to ensure that the generated code  has some validation that the results are what we expect.

Unit tests help here, and while I know these can be tedious to write and maintain, this is a great use for AI assistance. Generating unit tests, with default data based on data in current tables, is something AI agents can do well. They can also use these to verify functionality as code is generated and refactored. Of course, humans still need to be in the loop as there are plenty of reports where AI Agents write tests that return success without actually testing code. You need to validate the tests, and ensure your AI uses those tests to validate its work.

Something humans have done as well.

AI is an amazing tool, but like an intelligent, over-eager, junior developer, it needs clear communication and strong guidance.

And a little review of its work.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Remotely Engineer Fabric Lakehouse objects: The Fabric Modern Data Platform

John Miner from SQLServerCentral

In this next installments of the Modern Fabric Data Warehouse, we look at tools for developers.

External Article

SQL Server 2025 CREATE EXTERNAL MODEL and AI_GENERATE_EMBEDDINGS Commands Explained

Additional Articles from SimpleTalk

Now that SQL Server 2025 has finally been released to the public, I was finally able to test and learn a lot about this command (named CREATE EXTERNAL MODEL), and I want to share my knowledge with you here. If you’re new to the world of AI, don’t worry, we’ll start with the basics and evolve to where this command fits in!

Blog Post

From the SQL Server Central Blogs - Using CAT for Testing of Data Agents

Joyful Craftsmen from Joyful Craftsmen Blog

In last months one of the scenarios where you can use AI has been to build an agent which would answer your questions by looking into your data. It...

Blog Post

From the SQL Server Central Blogs - Are you getting value from your reporting?

ChrisJenkins from Chris Jenkins' Blog

Do you spend so long manipulating your data into something vaguely useful that you don’t have the time to focus on analysing the what the data is telling you?...

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):

 

Creating JSON III

In a SQL Server 2025 table, called Beer, I have this data:
BeerIDBeerName
1Becks
2Fat Tire
3Mac n Jacks
4Alaskan Amber
8Kirin
I run this code:
SELECT JSON_OBJECTAGG(
    BeerID: BeerName )
FROM beer;
What are the results?

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)

Lots of FKs

In SQL Server 2025, what are the most outgoing and incoming FK references a table can have?

Answer: outgoing: 253, incoming: 10,000

Explanation: We like to think in powers of 2, but apparently that doesn't apply here. Outgoing: 253, incoming: 10,000. This has been the same number for a number of versions. Ref: Maximum Capacity Specifications - https://learn.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server?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 2019 - Development
Which 'Where' statement conditional upon a variable - Thanks in advance for any clues on this. I am trying to write a 'conditional where' statement in a typical select statement. Early in the stored procedure the variable @Type is set to either 'AB or 'CD'. I'm trying to have my WHERE be dependent on that variable e.g.: WHEN @Type = 'AB' my "WHERE" […]
Integration Services
Foreach Loop still executes after process and delete all the folders - I have two challenges XML source control not displaying the XML file parent node columns even though it is showing in the XSD file. Is there any solution to get the XML parent nodes columns in the XML source component. Foreach loop container control not stopping. it still executes if more than two files in […]
Editorials
Doing Good at SQL Server Central - Comments posted to this topic are about the item Doing Good at SQL Server Central
Engineer Lessons - Comments posted to this topic are about the item Engineer Lessons
Microsoft Security Changes and SQL Server - Comments posted to this topic are about the item Microsoft Security Changes and SQL Server
Expanding into Print - Comments posted to this topic are about the item Expanding into Print
Article Discussions by Author
Missing the Jaro Winkler Distance - Comments posted to this topic are about the item Missing the Jaro Winkler Distance
25 Years Later: What SQLServerCentral Meant to Me - Comments posted to this topic are about the item 25 Years Later: What SQLServerCentral Meant to Me
Fun with JSON - Comments posted to this topic are about the item Fun with JSON
Creating JSON II - Comments posted to this topic are about the item Creating JSON II
Backup to Immutable Storage - Comments posted to this topic are about the item Backup to Immutable Storage
Downtime Caused by the Postgres Transaction ID Wraparound Problem - Comments posted to this topic are about the item Downtime Caused by the Postgres Transaction ID Wraparound Problem
The String Distance I - Comments posted to this topic are about the item The String Distance I
SQL Server 2022 - Development
connections vs apis - hi , i hear more and more that we have too many connections to our servers.    many are sql.   many arent. so we are told to use api's where possible. Isnt there a connection behind the scenes when an api is asked to return data from whatever the erp's database is>
is it true we cant debug c# scripts in ssis anymore under vs - Hi, i'm running vs2022.   I'm trying out a c# script that i'd like to set breakpoints on to trap the exception that gets thrown when i debug.  From what i'm reading, i cant debug it because my runtime bitness is 64 and that setting cant be changed (it is greyed for me) in vs2022. 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

 

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