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

How Much AI Code Would You Use?

I saw an article recently that a quarter of the Y Combinator startups have 95% of the code in their repos being AI generated. The article notes that if no other startups had any AI generated code (no idea the likelihood here, then about 24% of their code for startups is GenAI written.

24%

Is that high or low? If you think about all the code you've written in the last year, how much of it could be reasonably generated by AI? All the queries, schema changes, test code, dummy data insertions, refactoring to add a column to a table or result set. Could it be AI written?

Let's assume you practice a bit and you could quickly get some table, view, and sproc code. If I were to ask an AI to add a date column to a table and adjust the view and sproc code, is that useful? If I can move on to another task, or start setting up a prompt to add some test queries (or tsqlt tests) for me, that might make me more efficient. Certainly I'd still have to think of how to model this, but could the AI save time?

There is a lot of code that AIs might not write well. Certainly any dynamic SQL stuff that might be susceptible to SQL Injection worries me. An AI might write this, but so can a human. If the human doesn't understand this issue, then it doesn't matter if the AI writes it or the human does.

Except the human can make more mistakes in a period of time with an AI helper than by themselves. At least, I think they will unless they just can copy/paste/search/replace the code themselves. Then maybe they can do the same level of damage to a codebase.

The article has this great quote: "... even if product builders rely heavily on AI, one skill they would have to be good at is reading the code and finding bugs." That is very true, and it needs to be said to every manager, project leader, and executive. You still need trained, skilled, experienced developers.

This might be even more true for DBAs and ops people using AI to help them write scripts to change infrastructure. Plenty of people do this poorly now, but how many more quick scripts written by an AI will include unintended, insecure, or otherwise problematic code? People need to use the AI as a tool and review the output before using it.

So how much help could you get from an AI in your coding? 24%? 95% Let us know today.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Creating a Date Dimension (Calendar Table) in SQL Server

Noman072 from SQLServerCentral

Learn how to create and populate a Date Dimension table in SQL Server

External Article

How to Remove Constraints from a SQL Server Table

Additional Articles from MSSQLTips.com

I need to drop constraints on a number of my SQL Server tables. Most of our constraints are primary key and foreign keys, but there are other constraints too. How can we script it so it will deploy with a pipeline in a repeatable manner?

Blog Post

From the SQL Server Central Blogs - The Cost of Not Having a DBA

Kevin3NF from Dallas DBAs

Does skipping a DBA save money? Wait until your system grinds to a halt, your backups fail, or your cloud bill skyrockets. The “DBA? We Don’t Need No Stinkin’...

From the SQL Server Central Blogs - Distributed Availability Group Dashboard

david.fowler 42596 from SQL Undercover

The Distributed Availability Group Dashboard can be downloaded from our GitHub repo. https://github.com/SQLUndercover/UndercoverToolbox/blob/master/DAG%20Dashboard.pbix. This comes off of the back of my last post looking at using a distributed availability...

The Phoenix Project

The Phoenix Project: A Graphic Novel about IT, DevOps, and Helping Your Business Win

Site Owners from SQLServerCentral

Adapted from the acclaimed bestselling book, The Phoenix Project Graphic Novel Volume 1 introduces readers to a stalwart cast of characters as they are challenged by the four types of work that impact complex workflows.

 

 Question of the Day

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

 

Browsing for Instances

I have a SQL Server instance that is not listening for connections on port 1433. By default, all ports are locked down on my server, except for the SQL Server port. What can I do to allow users to connect to the instance without knowing the port?

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)

Upgrades to SQL Server 2022

What is the earliest version from which you can directly upgrade to SQL Server 2022?

Answer: SQL Server 2012 SP4

Explanation: The earliest version is SQL Server 2012 SP4 or later. Ref: Upgrade from Earlier Versions: https://learn.microsoft.com/en-us/sql/database-engine/install-windows/supported-version-and-edition-upgrades-2022?view=sql-server-ver16#upgrades-from-earlier-versions-to-sql-server-2022

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 - Administration
Changing Machine Type - Hi, presently my azure server running under Standard_D64ds_v4 .i am planning to upgrade the server . can you please help me what is next configuration .
SQL Server 2016 - Development and T-SQL
How to get result from deleted row - Hi Guys I have a store proc that delete a row from a and I would like to get the result of the deleted row whether be =1 or True in order to execute another store proc. Could this be possible? ---- I am aware this code won't work I am trying to explain what […]
Joining against min date only - This is one of those things very hard (for me)to explain in words. See image below, the requirement is assign all of the sales with Reqdate prior to the "Best Before Date"  but ONLY the earliest "Best Before Date." I am trying to do this only with T-SQL.  My full scenario is of course more […]
Union where it matches against only one shared column - Hi folks I have two tables, both with a NAME, START and END fields I'd like to list all of the rows from Table A, and then only the rows from Table B where only the START does not exist in Table A.  The NAMES in Table B will ALWAYS be different from those in […]
Administration - SQL Server 2014
sqlagent issue - could not find the procedure msdb.dbo.sp_get_sqlagent_properties agent not visible  
sql agent issue - getting this error. could not find the procedure msdb.dbo.sp_get_sqlagent_properties and also this error cannot find column msdb or user defined function or aggregate msdb.dbo.fn_syspolicy_is_automation_enabled  or name is ambiguous. how to fix this    
SQL Server 2019 - Development
what etl tool are folks moving toward? - Hi as we replace on prem machines , sometimes not with vm's, what should we be thinking about for etl? from my little corner of the world where we use both talend and ssis, and where talend is getting costly, and where ssis is slowly being squeezed into a call from data factory to an […]
How to update using data from three tables? - I am in the process of migrating from MySQL to SQL Server. I have tables like this: create table OldTable ( id int primary key, tagpath varchar(255), retired bigint ) create table DataTable ( tagid int not null, tagValue float ) create table NewTable( id int primary key, tagpath varchar(255), retired bigint ) The DataTable.tagid […]
temp table columns not showing up in CTE - I'm new to the development side of the house and stuck on a CTE issue. In the CTE data is pulled from a temp table. There was a request for more columns, so I added them. Everything works, but the columns don't show up in my CTE results? What am I overlooking here? Thank you […]
General
Count of Distinct Values - Hi If value is 21000030 it should return 4 not 5 . In first record 21000030 exists 2 times 21000032 then it should return 3 not 4. USE [Live] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[OCRD]( [CardCode] [nvarchar](15) NOT NULL, [Emp_1] [nvarchar](10) NULL, [Emp_2] [nvarchar](10) NULL, […]
Analysis Services
SSAS Cube Migration to Azure cloud - Dear All, I am currently working on a Proof of Concept (POC) where I have developed an SSAS cube with an Oracle (On-prem) source and deployed it to the SSAS server. The SQL DBA team is now planning to migrate the SQL server to the Azure cloud. I would appreciate your suggestions and best practices […]
SQL Server 2022 - Administration
Sever Migration - Hi, one of my server configured with Standard_D64ds_v4 what is next level of version is it Standard_D98ds_v4 or Standard_D128ds_v4
How to check if credential password for TDE matches the secret key of Key Vault - Hi all, In my company we have many databases encrypted with TDE and there is some automatic process or pipeline that is not working correctly and updates the secret key in the Key Vault without applying the change also in the credential password in the SQL server. I need some help while we found this […]
SQL Server 2022 - Development
Select Returning Blank Rows - I have the following select statement --#1 Select supplier, s.refnum, desc from supplier as S Where s.refnum = '123456' This brings back records for me. But when I use the field name instead like in #2, I get zero rows --#2 Select supplier, s.refnum, desc from supplier as S where s.refnum in (select refnum from […]
How to update a history table with changes. - Good morning to all.  I am a novice when it comes to SQL so my question is TSQL related on how to update a history table with changes to thousands of records without a cursor. Currently here is my code with cursor. I know I can update the price for all the parts in one […]
 

 

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

 

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