The AI/Human Spectrum

I was asked this question recently: is it more likely that AI will replace humans or assist them in their work?

It’s a good question. If you think about the way AI is being hyped in 2024, many people think AI is, or will soon be, replacing people and we need less of them in work. I guess the simplified view is that AI can do the jobs of many people, but I’m not sure the world is that simple. What I think is more likely is that AI becomes a lever that assists a few people in getting more work done and potentially replacing other, less knowledgable humans.

Maybe it’s the ultimate, do-more-with-less pressure that the management in many organizations places on workers that has people looking to AI to help. Get more done this year, but we’re not adding staff, and potentially we’re removing a few staffers. Maybe AI can do your job?

AI can be a lever, and I do think that there are tedious tasks that we might have AI take on for us. We’ll need more of an agent/proxy approach to AI systems, as now I can ask AI to do some things that relate to text/images, but not actually do work for me. I want an AI to actually set my Out-of-Office for me, not give me instructions on how to do it or write the message for respondents.

The current Generative AI/LLM systems aren’t really smart or intelligent, but they do process vast amounts of data and mimic the responses that other humans might give. If you work in an area that can benefit from that type of interaction, maybe an AI works well as a lever and lets you get more done on any given day. For some jobs.

However, getting more done might not be enough. If I pair program with someone else and they write a bunch of poorly performing code, it takes me time to judge the quality of what they’ve written and then additional time to fix it. Getting more done in that situation can be a burden because the additional code produced requires additional rework. I might get less work done in some cases if the code is low-quality and I use a lot of time to rewrite or improve the code.

However, if I am tackling simple tedious tasks, perhaps basic CRUD work in an application, maybe an AI can generate enough SQL, web, C#, etc. code that the job is done quicker. Maybe not at the most efficient level, but how many of you think the code for your internal applications is amazing? Is it good enough? Can an AI do “good-enough” work?

As with a lot of dramatic changes to technology, I find myself going back and forth on the value produced. Some days I think the tech is amazing and some days I think it’s akin to the stuff I shovel out of horse stalls. AI is in the same boat with me, and while I think there is potential, I know that there are also downfalls and potential detractions from its widespread use.

Certainly, the need to evaluate and judge quality is a challenge with AI, which leans me towards the lever that assists talented humans and replaces less talented ones. The other issue is cost. The LLMs are expensive, and use a lot of compute power. I’ve seen some smaller models, perhaps tailored with RAG or other methods of refining (and limiting) their use will overcome that, but who knows. The current models, however, cost something to run and someone is going to have to pay for that. Is there enough ROI to do that?

Lastly, trust. Can we really trust an AI to give us accurate responses, or even perform work on our behalf? We have that problem with other humans now, but they work slowly compared to a computer. Can you imagine the problems that a rogue computer system could create with access to change things in the real world?

Answer my question today. Are AIs more likely to assist or replace people?

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged | Comments Off on The AI/Human Spectrum

A New Word: Dolonia

dolonia – n. a state of unease prompted by people who seem to like you too much, which makes you wonder if they must have you confused with someone else – someone flawless, selfless, or easy to understand from a distance – feeling vaguely disappointed that they’re unwilling to spend the time it takes getting to know the real you.

I have a bit of dolonia when I meet some people at events who seem extra excited to meet me. I wonder sometimes if they think I’m someone I’m not. Not a different person, but their impression of what I’ve done with SQL Server Central seems outsized compared to what I think I’ve done.

Perhaps I have the opposite of dolonia, not realizing my own impact.

In either case, it’s a certainly a strange life I lead some days.

From the Dictionary of Obscure Sorrows

Posted in Blog | Tagged , | 2 Comments

A Very Cool Benefit in SSMS 21

I saw a post from Erin that Preview 2 is available. I’d gotten a message when I started SSMS v21 this morning, but got distracted.

I made a short video showing me getting the update, which is way, way easier and more convenient than it used to be.

Posted in Blog | Tagged , , | Comments Off on A Very Cool Benefit in SSMS 21

AI Helping with an API

Can an AI help me with some database API work? Let’s see.

This is part of a series of experiments with AI systems.

The Scenario

One of the things that helped me support a number of development teams with their database work was having code generate code. I had a piece of code that could read the system tables in SQL Server and produce insert, update, and delete procedures.

I wondered if an AI could do this easily.

Using Copilot

I decided to try this first in the Edge Copilot window. I wrote this prompt:Create the T-sQL code for insert, update, and delete procedures for these tables:

I then pasted in the code for 5 tables from Northwind, such as this one:

CREATE TABLE "Employees" ( "EmployeeID" "int" IDENTITY (1, 1) NOT NULL , "LastName" nvarchar (20) NOT NULL , "FirstName" nvarchar (10) NOT NULL , "Title" nvarchar (30) NULL , "TitleOfCourtesy" nvarchar (25) NULL , "BirthDate" "datetime" NULL , "HireDate" "datetime" NULL , "Address" nvarchar (60) NULL , "City" nvarchar (15) NULL , "Region" nvarchar (15) NULL , "PostalCode" nvarchar (10) NULL , "Country" nvarchar (15) NULL , "HomePhone" nvarchar (24) NULL , "Extension" nvarchar (4) NULL , "Photo" "image" NULL , "Notes" "ntext" NULL , "ReportsTo" "int" NULL , "PhotoPath" nvarchar (255) NULL , CONSTRAINT "PK_Employees" PRIMARY KEY CLUSTERED ( "EmployeeID" ), CONSTRAINT "FK_Employees_Employees" FOREIGN KEY ( "ReportsTo" ) REFERENCES "dbo"."Employees" ( "EmployeeID" ), CONSTRAINT "CK_Birthdate" CHECK (BirthDate < getdate()) ) GO CREATE INDEX "LastName" ON "dbo"."Employees"("LastName") GO CREATE INDEX "PostalCode" ON "dbo"."Employees"("PostalCode") GO

I got this result:

-- Insert Procedure
CREATE PROCEDURE InsertEmployee
     @LastName nvarchar(20),
     @FirstName nvarchar(10),
     @Title nvarchar(30),
     @TitleOfCourtesy nvarchar(25),
     @BirthDate datetime,
     @HireDate datetime,
     @Address nvarchar(60),
     @City nvarchar(15),
     @Region nvarchar(15),
     @PostalCode nvarchar(10),
     @Country nvarchar(15),
     @HomePhone nvarchar(24),
     @Extension nvarchar(4),
     @Photo image,
     @Notes ntext,
     @ReportsTo int,
     @PhotoPath nvarchar(255)
AS
BEGIN
     INSERT INTO Employees (LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath)
     VALUES (@LastName, @FirstName, @Title, @TitleOfCourtesy, @BirthDate, @HireDate, @Address, @City, @Region, @PostalCode, @Country, @HomePhone, @Extension, @Photo, @Notes, @ReportsTo, @PhotoPath)
END
GO
-- Update Procedure
CREATE PROCEDURE UpdateEmployee
     @EmployeeID int,
     @LastName nvarchar(20),
     @FirstName nvarchar(10),
     @Title nvarchar(30),
     @TitleOfCourtesy nvarchar(25),
     @BirthDate datetime,
     @HireDate datetime,
     @Address nvarchar(60),
     @City nvarchar(15),
     @Region nvarchar(15),
     @PostalCode nvarchar(10),
     @Country nvarchar(15),
     @HomePhone nvarchar(24),
     @Extension nvarchar(4),
     @Photo image,
     @Notes ntext,
     @ReportsTo int,
     @PhotoPath nvarchar(255)
AS
BEGIN
     UPDATE Employees
     SET LastName = @LastName, FirstName = @FirstName, Title = @Title, TitleOfCourtesy = @TitleOfCourtesy, BirthDate = @BirthDate, HireDate = @HireDate, Address = @Address, City = @City, Region = @Region, PostalCode = @PostalCode, Country = @Country, HomePhone = @HomePhone, Extension = @Extension, Photo = @Photo, Notes = @Notes, ReportsTo = @ReportsTo, PhotoPath = @PhotoPath
     WHERE EmployeeID = @EmployeeID
END
GO




-- Delete Procedure
CREATE PROCEDURE DeleteEmployee
     @EmployeeID int
AS
BEGIN
     DELETE FROM Employees WHERE EmployeeID = @EmployeeID
END
GO

Here’s an image of what I saw:

2024-11_0126

You might ask if this is better than what I’d write. I wondered myself, so I asked it to change the update procedure slightly. Here’s the prompt and result:

2024-11_0127

-- Update Procedure
CREATE PROCEDURE UpdateEmployee
     @EmployeeID int,
     @LastName nvarchar(20) = NULL,
     @FirstName nvarchar(10) = NULL,
     @Title nvarchar(30) = NULL,
     @TitleOfCourtesy nvarchar(25) = NULL,
     @BirthDate datetime = NULL,
     @HireDate datetime = NULL,
     @Address nvarchar(60) = NULL,
     @City nvarchar(15) = NULL,
     @Region nvarchar(15) = NULL,
     @PostalCode nvarchar(10) = NULL,
     @Country nvarchar(15) = NULL,
     @HomePhone nvarchar(24) = NULL,
     @Extension nvarchar(4) = NULL,
     @Photo image = NULL,
     @Notes ntext = NULL,
     @ReportsTo int = NULL,
     @PhotoPath nvarchar(255) = NULL
AS
BEGIN
     UPDATE Employees
     SET LastName = COALESCE(@LastName, LastName),
         FirstName = COALESCE(@FirstName, FirstName),
         Title = COALESCE(@Title, Title),
         TitleOfCourtesy = COALESCE(@TitleOfCourtesy, TitleOfCourtesy),
         BirthDate = COALESCE(@BirthDate, BirthDate),
         HireDate = COALESCE(@HireDate, HireDate),
         Address = COALESCE(@Address, Address),
         City = COALESCE(@City, City),
         Region = COALESCE(@Region, Region),
         PostalCode = COALESCE(@PostalCode, PostalCode),
         Country = COALESCE(@Country, Country),
         HomePhone = COALESCE(@HomePhone, HomePhone),
         Extension = COALESCE(@Extension, Extension),
         Photo = COALESCE(@Photo, Photo),
         Notes = COALESCE(@Notes, Notes),
         ReportsTo = COALESCE(@ReportsTo, ReportsTo),
         PhotoPath = COALESCE(@PhotoPath, PhotoPath)
     WHERE EmployeeID = @EmployeeID
END
GO

That’s interesting. If I pass in nulls for everything, I get an update in place. Not quite what I’d do, as I’d check if the param was null and not include it in an update, which could reduce logging, but this is likely just as efficient.

Easy code to write for sure, and I could likely put together a bit of code to do this for me, but it’s nice that I can quickly ask an AI to do this. I think this is the type of thing that might be easier for developers to do, and maybe more likely. They get to play with AI and feel more productive. They can even alter a table and “re-ask” for new procedures where they can interact with the table.

What’s more, the INSERT procedures have the explicit column lists, so this means I could rev the underlying table without breaking this code. It’s a good coding practice, but far too many people would just embed a this in their code:

insert Employee values ‘Jones’, ‘Steve’, ‘Editor’, …

A quick thing, but Copilot seemed to work well here.

Posted in Blog | Tagged , | Comments Off on AI Helping with an API