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

More Documentation is Needed

AI is everywhere, and if you spend any amount of time looking for answers on the Internet to your coding challenges, you've likely encountered a lot of poor, average, good, bad, amazing, and just-helpful-enough AI content. For a while I was avoiding the AI summary from Google as the quality seemed slightly off, but lately it's gotten good enough that I use it to choose which links I click on in the results. The summary helps me better understand the context Google sees in my search query.

I ran across a post on coding documentation and how helpful these docs are in onboarding, code reviews, and more. The teams that worked smoothly together often had good docs that helped them function as a cohesive group. At least to some extent. Over time, we started to depend on tools and lost some of that cohesiveness since we relied more on tools than docs. I agree that's a part of the reason many teams don't really function as teams.

In the age of AI, this becomes more important. These AI agents are smart, but gullible and prone to making inconsistent decisions if you let them. In the piece, there's a great quote: "When your codebase follows consistent patterns, AI assistants become force multipliers. When it doesn’t, they become chaos amplifiers." Or as we data people know it, garbage in, garbage out.

The lack of documentation means a lack of guidance for both humans and AI agents. It's easy to say AI makes crazy decisions when we feed it our code, but humans do the same thing. I can't even begin to count the number of weird decisions over structure and naming I've seen from other humans when I didn't provide them guidance.

It happens even when I give them standards, but at least then we can have a conversation about attention to detail if there are docs.

I saw Brent's predictions for AI database development in 2026, and part of the challenge in getting AI to be helpful is the lack of docs many of us have on schemas. I can't tell you how often I've been asked if Redgate has tools that can doc a schema and decipher what data is being stored. Microsoft spent a billion+ on Purview, and its results in classification are a mixed bag. It's a hard problem, and a lot of the problem is us. We don't make good decisions about what to name columns or tables, we're inconsistent, and we reuse columns as our requirements change, subtly altering the data being stored. Usually, this is an overloading of two types of similar, but different, data into one column. Sometimes it's just storing whatever we want in a column (or allowing a user to do so).

I'd like to think that the growth of AI will result in a little more attention being paid to documenting our data stores. I'd hope this results in at least using the extended properties or COMMENT capabilities of the different platforms. I think having better ER diagrams might be a second step, though certainly with some AI assistance to help keep things in sync as we evolve our schemas.

This is tedious work, and it's not something humans are good at, or want to, update over time. However, if an AI agent were around to do the work and then let a human check the results, I suspect we might do a better job of keeping things up to date. To me, that's another place where the AI revolution might benefit us all.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Leveraging DuckDB for OLAP Workloads: The Fabric Modern Data Platform

John Miner from SQLServerCentral

This next article in the Fabric Modern Data Platform looks at DuckDB, an analytical database platform designed for analytics

External Article

Power BI Quick Reference Guide

Additional Articles from MSSQLTips.com

I need a structured reference guide to help me get started or expand on Power BI knowledge. I want to be able to bookmark a resource and then use it daily when needed as I build my data sets, reports, and dashboards. Can you please enumerate some common and helpful resources as a Power BI Quick Reference guide?

Blog Post

From the SQL Server Central Blogs - Runing tSQLt Tests with Claude

Ed Elliott from Ed Elliott's Sql Developer Blog

Running tSQLt unit tests is great from Visual Studio but my development workflow isn’t just write tests, run tests, fix tests, run tests anymore, it is 2026 and...

Blog Post

From the SQL Server Central Blogs - Getting Your Data GenAI-Ready: The Next Stage of Data Maturity

James Serra from James Serra's Blog

I remember a meeting where a client’s CEO leaned in and asked me, “So, we have tons of data… Why can’t we just add AI and call it a...

Learn Microsoft Fabric: A practical guide to performing data analytics in the era of artificial intelligence

Site Owners from SQLServerCentral

A step-by-step guide to harness the power of Microsoft Fabric in developing data analytics solutions for various use cases

 

 Question of the Day

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

 

Adding and Dropping Columns II

I have this table in my SQL Server 2022 database:
CREATE TABLE [dbo].[CityList]
(
[CityNameID] [int] NOT NULL IDENTITY(1, 1),
[CityName] [varchar] (30) ,
[Country2] [char] (3),
[stateprovince2] [char] (2),
[Country] [char] (3),
[stateprovince] [char]
) ON [PRIMARY]
GO
I decide to drop the stateprovince2 and country2 columns. What code should I use?

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)

Encoding Strings

I have this code in SQL Server 2025. What is the result?

DECLARE @message VARCHAR(50) = 'Hello SQL Server 2025!';
DECLARE @encoded VARCHAR(MAX);

SET @encoded = BASE64_ENCODE(@message);
SELECT @encoded AS EncodedResult;

Answer: An error

Explanation: This returns an error. The BASE64_ENCODE function requires a binary input. Ref: BASE64_ENCODE() - https://learn.microsoft.com/en-us/sql/t-sql/functions/base64-encode-transact-sql?view=fabric-sqldb&viewFallbackFrom=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 - Development and T-SQL
Script Task execution error with HTTP request - I have a script task that tries to execute a HTTP request, which seems to work in isolation - when manually clicking on the URL, it will perform the action successfully. The problem is that when executing the whole task it produced this error : [HTTP Request Error] Error: An error occurred while sending the […]
Azure Data Factory
Azure-SSIS, Self-Hosted Integration Runtime, & Data Gateway? - Looking to confirm my understanding of these three products and how they can be used in an Azure environment, prior to our moving on-prem databases to Azure SQL. I'm fairly sure I understand the Data Gateway product, as we have several apps using it, it's the other two I'm less certain I understand the use […]
Editorials
Deep Learning and Craftsmanship Matter - Comments posted to this topic are about the item Deep Learning and Craftsmanship Matter
Learning From Breakage - Comments posted to this topic are about the item Learning From Breakage
Article Discussions by Author
Encoding Strings - Comments posted to this topic are about the item Encoding Strings
Building a Real-Time Analytics Pipeline with Azure Stream Analytics and SQL Server - Comments posted to this topic are about the item Building a Real-Time Analytics Pipeline with Azure Stream Analytics and SQL Server
What is Page Density - Comments posted to this topic are about the item What is Page Density
T-SQL in SQL Server 2025: Fuzzy String Search II - Comments posted to this topic are about the item T-SQL in SQL Server 2025: Fuzzy String Search II
Python in Action to Auto-Generate an Optimized PostgreSQL Index Strategy - Comments posted to this topic are about the item Python in Action to Auto-Generate an Optimized PostgreSQL Index Strategy
Adding and Dropping Columns I - Comments posted to this topic are about the item Adding and Dropping Columns I
SQL Server 2025 Standard Developer Edition - Comments posted to this topic are about the item SQL Server 2025 Standard Developer Edition
URL Safe or Not? - Comments posted to this topic are about the item URL Safe or Not?
SQL Server 2022 - Administration
Basic Always On Groups Randomly Stop Synchronizing - In one of my environments I have 3 pairs of Always On SQL 2022 Servers (CU18), Standard Edition with BAGs. I'm finding that randomly one or more of the BAGs stops synchronizing and the only way to resolve this is to pull the DB from the BAG and add it back again. The error information […]
Cumulative Update 23 - KB5074819 - Database Mail - No longer working. - Hi there, Has anyone else had any trouble with Database Mail in Cumulative Update 23 - KB5074819? When we upgraded from CU 22 to CU 23, we suddenly stopped getting email alerts on two of our SQL Servers that we upgraded.  The other SQL Servers that are on CU 22, database mail continues to work […]
SQL Server 2022 - Development
sys.query_store_query question - All, My query is as follows: SET DATEFORMAT dmy SELECT p.query_id, DATEADD(MICROSECOND,-rs.max_duration,rs.first_execution_time) AS starttime, first_execution_time AS endtime, q.last_optimize_cpu_time FROM sys.query_store_query_text t JOIN sys.query_store_query q ON t.query_text_id = q.query_text_id INNER JOIN sys.query_store_plan p ON q.query_id = p.query_id INNER JOIN sys.query_store_runtime_stats rs ON rs.plan_id=p.plan_id WHERE OBJECT_NAME(q.object_id) = 'x' AND (rs.first_execution_time BETWEEN '19/01/2026 00:00:00' AND '19/01/2026 23:59:59' OR […]
 

 

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

 

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