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

Development Is Fun

I was listening to The Pragmatic Engineer interview Casey Muratori about high-performance code, which I found really interesting. I'm actually considering going through his Performance Aware Programming series and (re)learning some assembly. I never thought I'd even consider doing that.

Casey is a game programmer, and there was a question in the interview about how he uses AI tools in his work. "We are not using them" was not the answer I expected. Perhaps even more interesting was the rest of the answer. Casey loves programming and wants to enjoy what he does. He writes the code because he wants to do the work. If he didn't, he'd license some technology, not spend time getting an AI to do the work.

It's an interesting interview, but it made me wonder how many people out there enjoy their work. How many want to go to work and get things done? Certainly, people want to get paid, but I would hope a lot of you have a job you enjoy doing, and aren't necessarily looking to get someone, or something, to do the work for you.

And how many go primarily because they have bills and need the paycheck? Would you rather be doing something else if you didn't need the money?

I love solving problems with customers, testing technology, and puzzling over the approaches to take when confronted with a challenge. I enjoy going to work, and while the paycheck matters, I like doing the work. I have no interest in retiring from my current job, as it's fun. It's hard some days, but mostly it's fun.

Do you still enjoy writing code? Or configuring and tuning servers? Or whatever you do? Are you looking forward to the day when you don't have to do this job anymore?

I don't expect many people to comment unless they enjoy their jobs, but if you do, let me know.

Steve Jones - SSC Editor

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

 
 
 Featured Contents
SQLServerCentral Article

Optimized Locking in SQL Server 2025

Daniel Calbimonte from SQLServerCentral

Learn about Optimized Locking in the latest versions of SQL Server and Azure SQL Database.

External Article

How to mirror data from SQL Server to Microsoft Fabric: complete guide

Additional Articles from SimpleTalk

Learn all about Microsoft Fabric mirroring for SQL Server: how it works, what's new in 2025, setup, limitations, and troubleshooting

Technical Article

Take the 2027 State of the Database Landscape Survey

Press Release from SQLServerCentral

Share your view on the database landscape and you could win USD$500.

Blog Post

From the SQL Server Central Blogs - Creating a Local Model Chatbot on Windows

Steve Jones - SSC Editor from The Voice of the DBA

After my session at VSLive last week, I had a few questions from the audience. I’m adding some of these into blogs, and this was one: How do I...

Blog Post

From the SQL Server Central Blogs - To refer and to be referred

Diligentdba 46159 from Mala's Data Blog

Referrals have never been more important in the job market. They’re no longer nice to have; in many cases, they’re what gets your résumé through the door. I’ve been...

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

 

Hyperscale Replicas III

In an Azure SQL Database Hyperscale Edition, how many named replicas can be configured?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Thomas Franz)

Adding new column with DEFAULT II

Which number did the two COUNT(*) return:

DROP TABLE IF EXISTS #tmp
CREATE TABLE #tmp (id INT NOT NULL)

INSERT INTO #tmp (id) 
SELECT gs.value
  FROM GENERATE_SERIES(1, 5) AS gs

ALTER TABLE #tmp ADD my_value INT NOT NULL CONSTRAINT df_tmp_my_value DEFAULT 1

SELECT COUNT(*)  FROM #tmp AS t WHERE my_value = 1

ALTER TABLE #tmp DROP CONSTRAINT df_tmp_my_value

ALTER TABLE #tmp ADD CONSTRAINT df_tmp_my_value DEFAULT 2 FOR my_value

SELECT COUNT(*)  FROM #tmp AS t WHERE my_value = 1

Answer: both 5

Explanation: When you are adding a new column that does not allow NULL values you have to specify a DEFAULT constraint - otherwise you receive the error 4901 "ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column 'my_value' cannot be added to non-empty table '#tmp' because it does not satisfy these conditions." The value of the specified DEFAULT will be saved in the columns meta data (sys.system_internals_partition_columns), so no rewrite of the possible very large table is necessary. It will not be changed, when you are dropping the CONSTRAINT later or even creating another one. You can use the following query to verify check the saved initial value for the column:

SELECT
    c.name,
    i.has_default,
    i.default_value
FROM tempdb.sys.partitions p
JOIN tempdb.sys.system_internals_partition_columns i
    ON p.partition_id = i.partition_id
JOIN tempdb.sys.columns c
    ON c.object_id = p.object_id
   AND c.column_id = i.partition_column_id
WHERE p.object_id = OBJECT_ID('tempdb..#tmp')
  AND p.index_id IN (0,1);

 

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
Querying Multiple Tables for the Same Information - I have about 100 Tables that are all suffixed with _Modify. These tables record changes made to these 100 tables. Each of these tables may or may not contain a column called 'User' to record the userid  of who made the change. I can get the names of all the tables with the following query: […]
Editorials
Designing for Teams - Comments posted to this topic are about the item Designing for Teams
Absolute and Relative References - Comments posted to this topic are about the item Absolute and Relative References
Get Along - Comments posted to this topic are about the item Get Along
Finely Tuned Models - Comments posted to this topic are about the item Finely Tuned Models
Make It Routine - Comments posted to this topic are about the item Make It Routine
Older Versions of SQL (v6.5, v6.0, v4.2)
Looking for old SQL Server 1.x - 4.21 disks, manuals, boxes, etc. - Hi everyone, I'm hoping some of the longtime SQL Server professionals here might be able to help me with something. I've been doing a lot of research into the earliest versions of SQL Server for SQL.FM, a SQL Server version and feature reference site I maintain, and as part of this effort I've also started […]
Article Discussions by Author
Checking the Error Log II - Comments posted to this topic are about the item Checking the Error Log II
Parameter Sniffing on SQL Server 2025: A Walkthrough with Real Numbers - Comments posted to this topic are about the item Parameter Sniffing on SQL Server 2025: A Walkthrough with Real Numbers
Moving Beyond the Reboot: Finding the Culprit Behind Memory Pressure - Comments posted to this topic are about the item Moving Beyond the Reboot: Finding the Culprit Behind Memory Pressure
Reserved Words I - Comments posted to this topic are about the item Reserved Words I
RegEx Functions III - Comments posted to this topic are about the item RegEx Functions III
Optimized Locking in SQL Server 2025: Fewer Locks, Less Blocking, and the Cases It Cannot Fix - Comments posted to this topic are about the item Optimized Locking in SQL Server 2025: Fewer Locks, Less Blocking, and the Cases It Cannot Fix
Finding Gaps in Sequential Data Using SQL Server - Comments posted to this topic are about the item Finding Gaps in Sequential Data Using SQL Server
Negative and Positive Numbers - Comments posted to this topic are about the item Negative and Positive Numbers
 

 

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

 

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