Tag: career

  • Experimenting with CHOOSE: #SQLNewBlogger

    I was looking over the CHOOSE() function while editing an article at SQL Server Central. I realized there isn’t a documentation note on how many parameters can be included. I decided to test.

    This post looks at the tests and results.

    Tl;dr It appears 3925 is the most arguments.

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    Building a Script

    Since I want to know where things fail, I decided to make a short T-SQL script that tests increasing numbers of parameters. This script builds a dynamic CHOOSE() select using a number of parameters and then loops for a set number of times, adding 1 parameter each time.

    SET NOCOUNT ON; DECLARE @MaxValues int = 5150; -- largest number of CHOOSE value arguments DECLARE @n int = 300; -- current number of value arguments DECLARE @i int; DECLARE @idx int; DECLARE @args nvarchar(max); DECLARE @sql nvarchar(max); WHILE @n <= @MaxValues BEGIN -- Build value list: 'Value 1', 'Value 2', ... 'Value n' SET @args = N''; SET @i = 1; WHILE @i <= @n BEGIN SET @args += CASE WHEN @i > 1 THEN N', ' ELSE N'' END + N'N''V' + CAST(@i AS nvarchar(10)) + N''''; SET @i += 1; END; -- Random index in 1..n (CHOOSE is 1-based; out of range returns NULL) SET @idx = ABS(CHECKSUM(NEWID())) % @n + 1; SET @sql = N'SELECT ' + CAST(@n AS nvarchar(10)) + N' AS ArgCount, ' + CAST(@idx AS nvarchar(10)) + N' AS PickedIndex, ' + N'CHOOSE(' + CAST(@idx AS nvarchar(10)) + N', ' + @args + N') AS Result;'; PRINT @sql; -- show the generated statement EXEC sys.sp_executesql @sql; -- run it SET @n += 1; END;


    This returns the command run. For the first 2 values of n, setting @n to 1 and @max to 2, I get this:

    SELECT 1 AS ArgCount, 1 AS PickedIndex, CHOOSE(1, N'V1') AS Result;
    SELECT 2 AS ArgCount, 1 AS PickedIndex, CHOOSE(1, N'V1', N'V2') AS Result;

    This let me test different values. I tried various values and eventually got this error:

    2026-09_0159

    I tried this a few different times, disconnecting and reconnecting and it seemed that I could get the number of parameters up to 3925. It failed sometimes at 3924 and sometimes at 3925.

    I’ve submitted a PR to add the max number to the docs, but it appears CHOOSE() works at a level that would cover lots of items. I see this as a small syntactic sugar add, and if I really needed to index 1000 entries, a join with a reference table would be a better choice.

    SQL New Blogger

    This script took a few minutes to write, but the testing took about 45 minutes. I was running this in the background with different values. 1..256, 255..1024, etc. I noticed that SSMS responded slower, so I started jumping to small ranges at large values to find the error.

    This post took me about 20 minutes to put together after the testing, which included the PR for Microsoft. This is an easy way to show that you can examine possibilities and find the limits of your code. That helps us decide how scalable or robust our solutions are.

    You could write this post and impress an interviewer. Choose your own T-SQL function and run an experiment.

  • Making an Impression

    It’s a weird time in the job market. Companies are hiring, and I see friends and colleagues starting new positions. At the same time, I have had many more friends reach out, saying they are struggling to find employment, and job searches are dragging on for months. I sympathize, and it certainly seems that lots of people are trying to hold onto their existing positions.

    Whether you’re looking for a new position or trying to create security in your existing role, it pays to be aware of the impression you leave in the world. Is it a positive one? Do others want to work with you? Or maybe you find people gravitate towards others. Are they impressed with your output? Satisfied? Left wanting?

    Maybe a better question is: if you were running your team, would you hire you again?

    I think it’s a very human tendency to overestimate our abilities and underestimate our weaknesses. That’s why 90+% of people rate themselves as above-average drivers. In my travels, I find plenty of people who aren’t very self-aware of the impression they make, good or bad. Lots of people aren’t very observant, which is another human tendency.

    Recently, a friend was hiring for a position and noted that they received a large number of resumes and cover letters with spelling and grammar mistakes. They deleted those and then started to review the rest. They also mentioned that while checking LinkedIn, they were turned off by people who hadn’t added their picture. I’m not sure if those candidates were discarded.

    Whether you think those are valid reasons to judge others, the reality of the world is that humans judge each other. We have our own prejudices, attractions, turn-offs, and more that influence our decisions. It’s easy to say that you’ll pick the best candidate, but that’s much harder in practice. Many of us fall into buckets with lots of others who are applying. How do we stand out?

    It can be hard, especially when different people form different impressions from the same experience. Not enough experience is a challenge, and these days too much experience can also be a challenge. There are plenty of hiring managers who might not consider a candidate if their impression of a candidate is “too old”, “too expensive”, or “too set in their ways.”

    It’s a tough world these days, and AI doesn’t help. What I can say is that you should be aware of the impression you make and work to regularly improve it. It’s unlikely you’re clearly above or below others who have similar experiences and skills, but building a preponderance of evidence that you are a good hire might make a difference.

    Steve Jones

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

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

  • 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. I learned Assembly in high school and university, and I didn’t enjoy it.

    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 game engine or 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

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

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

  • Get Along

    I enjoy listening to Get Along by Kenny Chesney periodically, often smiling to myself. I was reminded of this song recently while talking about careers and the AI impact during VSLive San Diego.

    On one hand, most of the people I surveyed or chatted with were using AI to accomplish some tasks. However, very few are using it in a way that would eliminate their positions or do the majority of their work. On the third hand, lots of them worry about their organizations attempting to get by with more AI and less humans in the future.

    I think that last one is a natural point of view in the world today. I’m sure plenty of executives are hoping they can reduce their future labor costs with machine assistance. Quite a few are finding that the machine assistance isn’t that cheap, and humans are still needed. I don’t know where this will shake out in the future, but I guess that many of our organizations will shrink a bit and use less developers than they might have now. I also think there will still be plenty of developer jobs, but AI will be used judiciously to supplement the capabilities of workers.

    This means workers will need to know how to work with AI effectively and efficiently.

    Perhaps there will be new departments and new companies that spring up and create the need for more workers. I hope that’s the case, but I bet a lot of teams will lose some humans and replace them with AI. The cost of benefits continues to rise, and I don’t know that many companies will grow their businesses enough to keep all their humans and spend on AI. That’s adding lots of salary/token costs because of growth. Some organizations will have a lot of growth, but I suspect many companies will see that they have tasks that need humans and tasks that don’t.

    The common question from our discussions was “which humans will stick around?”

    Technical competency isn’t likely to be the deciding factor. You being a 10x engineer or the best coder might not keep you around. Spotting problem code and better guiding AIs will matter. The mentorship skills you use with junior staffers, and the patience, will become important. Some people are learning those skills now.

    The one thing most people agree on is that you should get along well with others. Those soft skills – the ability to communicate, being pleasant, making others feel not only comfortable but wanting to work with you – will matter most. If others don’t enjoy collaborating with you, especially your boss, I can see your position being precarious and potentially slotted for a layoff.

    This isn’t to say you can’t argue a point of view or debate an approach. The thing you should remember is that when you do present your view, it is seen as an engaging and spirited debate, not an antagonistic war. People want to work with others when they feel some bond with them. When they don’t, they might be indifferent or even dread interactions. Feeling dread, hesitation, or a reluctance to engage is a sign that someone isn’t a part of a team.

    Those who aren’t part of the team might be the easiest to replace with an agent in the future.

    Steve Jones

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

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