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

Doing the Little Things

I wrote a blog about sitting at LHR recently and watching planes take off. That's been a fun thing for me as a plane rolls down the runway every 35-45s during busy times. I was sitting by a window in the hotel, working and watching.

There was a moment when I realized no planes were taking off. I looked and saw a vehicle rolling down the runway, and then realized there were two, one from each direction. It was an runway FOD inspection, looking for anything that might damage a plane.

It's a little thing that has to be done regularly.

How many of you do little things in your job? Do you clean up old logs/backups/ETL source files? Do you double-check security for old/expired accounts, unused databases, forgotten audits/traces, etc.? Maybe do you check the status of patches across your database estate? Is there something else you should do semi-regularly?

I've seen many people (including myself) lose track of things over time because there are so many. My phone (or pager) has rung so many times because a system ran out of disk space due to old files that accumulated over time. Those log files might not be be large, but after years the size can add up. And they'll fill up a disk at night, not during working hours.

This is where AI might help. I've written many little scripts that helped me clean things, but they were often brittle and focused on a specific task. Generalizing them would take too much effort, and might not even be possible. After all, sometimes I'm not even sure what the general case would be when building the utility.

AI coding agents can help us in this space. Ask an AI for a script to remove old backup files, leaving the last few. Perhaps you want to look for unused accounts. You can ask an AI to setup an audit to scan for login times (script one) and then process the results to get the last login time for each account (script two). The action might be to disable accounts that haven't logged in for six months (script three). Set these scripts to run ad hoc or on a schedule as needed. Just be sure you have a calendar entry to remind you to check the results.

Each of these scripts isn't that complex, but across many systems, perhaps with slightly different requirements and situations, you might not have time to adjust each script or even build them. However, if you can think about a small utility, an AI can help you build it. Just be sure you also ask the AI to set up tests to ensure the script works as intended. This is especially important since you'll likely be asking the AI to refactor or change the code and want to prevent regression bugs.

Doing the little things at work can eat up a lot of time, but building small utilities can help you can ensure that your systems run smoothly. And ensure you still get home in time for dinner.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Seeding a Fabric Warehouse with dbt for Visual Studio Code: The Fabric Modern Data Platform

John Miner from SQLServerCentral

In this next installment, we look at using dbt to seed a Fabric Warehouse.

External Article

What are database keys? A practical guide

Additional Articles from SimpleTalk

There’s not much to database keys, right? When you build a new table, you add a column to act as the primary key, then set it to auto-generate. Done. That’s all there is to know…right?

Blog Post

From the SQL Server Central Blogs - March 2026 SQL Server Security Updates

K. Brian Kelley from Databases – Infrastructure – Security

On Patch Tuesday, in addition to OS and Office security patches, Microsoft also released patches for SQL Server to address privilege escalation vulnerabilities in supported versions. Time to patch!

Blog Post

From the SQL Server Central Blogs - How Fabric Mirroring Transformed with SQL Server 2025

Meagan Longoria from Data Savvy

When mirroring was first released for Azure SQL Database, it used Change Data Capture (CDC). That is still what is used to mirror SQL Server 2016 – 2022. SQL...

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

 

Historical Data Tracking

If I want to track historical data values, which mechanism 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)

Odd Sequences

What values are returned from this code?

CREATE SEQUENCE NumericSequence
    AS NUMERIC(5,1)
    START WITH 1.0
    INCREMENT BY 0.1;
GO
SELECT NEXT VALUE FOR NumericSequence
GO
SELECT NEXT VALUE FOR NumericSequence
GO

Answer: An error

Explanation: This returns an error. While a sequence supports the numeric datatype, the scale must be 0. Ref: Sequence numbers - https://learn.microsoft.com/en-us/sql/relational-databases/sequence-numbers/sequence-numbers?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
query to track time spent on individual tasks in SSIS - Hi everyone I am looking at building a query to determine how much time is being spent on each task in SSIS.  My SSIS package has a few containers and within each container there are tasks.  Once one container finishes processing then the next container gets processed.  I have never done this before so I […]
how to write this query? - Hi everyone I asked this earlier but the desired outcome is a bit different this time so I am starting a new post.  I would like to transform the source table into the desired outcome format.  How can I do this? Desired Outcome: Sample Data: drop table if exists #temp1 create table #temp1 ( report_run_time […]
Editorials
Everything is the right question away - Comments posted to this topic are about the item Everything is the right question away
Hidden Heroes - Comments posted to this topic are about the item Hidden Heroes
Changing Data Types - Comments posted to this topic are about the item Changing Data Types
Breaking Down Your Work - Comments posted to this topic are about the item Breaking Down Your Work
Article Discussions by Author
Vectors in SQL Server 2025 - Comments posted to this topic are about the item Vectors in SQL Server 2025
Odd Sequences - Comments posted to this topic are about the item Odd Sequences
SQL Server Transactional Replication from Always On Availability Groups to Azure SQL Database - Comments posted to this topic are about the item SQL Server Transactional Replication from Always On Availability Groups to Azure SQL Database
Identities and Sequences I - Comments posted to this topic are about the item Identities and Sequences I
Fun with JSON II - Comments posted to this topic are about the item Fun with JSON II
Answering Questions On Dropped Columns - Comments posted to this topic are about the item Answering Questions On Dropped Columns
Restoring On Top II - Comments posted to this topic are about the item Restoring On Top II
SQL Art 2: St Patrick’s Day in SSMS (Shamrock + Pint + Pixel Text) - Comments posted to this topic are about the item SQL Art 2: St Patrick’s Day in SSMS (Shamrock + Pint + Pixel Text)
SQL Server 2022 - Development
VS Code, Unresolved References. - Hi all, I just started using VS Code to work with DB projects.  I have a work-in-progress DB, meaning some of the objects are broken.  But, for those that are not broken, when I run dotnet build I get many unresolved reference errors that have no problem existing on the server or in SSMS.  The […]
 

 

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

 

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