Tag: career

  • Helping an English Student with R

    I got an interesting message from my daughter recently. She’s doing graduate studies in Belgium at KU Leuven. Her field is literature and linguistics, and as part of that, she has to analyze various writings. While visiting with her last month, she mentioned that her professor was using R (R Language) and giving them scripts to run to look at language usage.

    The other day she texted that her R script wasn’t running and could she get some help. She was a little intimidated to ask the professor why the script didn’t run on her laptop, when she saw it running in class on the professor’s machine. I had some time, so we started a screen-sharing session on WhatsApp, which is amazing. Side note, I can’t believe I can talk with my daughter and watch her work on her computer in real time, with a few clicks of a button.

    In any case, she told me she was getting a file size error. She couldn’t load a 32MB file because the RStudio limit was 5MB. That seemed a little funny to me, as I’ve had some large files loaded into RStudio. My suspicion was that this error was masking another problem, but I watched my daughter work to see.

    What she had done:

    1. download a zip file
    2. extract this to a new folder in Documents
    3. open the R script in RStudio
    4. drag the text file for analysis into RStudio

    That seemed strange. In looking at her script, I realized there was likely a pathing issue. We ran a getwd() and then a setwd() to experiment. We got a different error, which looked to me like a collation/formatting issue. We added a fileEncoding parameter to read.delim() and the script started working. She was amazed and pleased.

    Explaining the technical aspects of this to an English(ish) student, and helping her to lightly understand what to do was interesting. She made notes in a file on using setwd(), changing backslashes from Explorer to forward slashes, and how to add the parameter to the various read commands. Ultimately, she was back to being productive, without learning much about R or technology, but having a path forward of things to try when something broke, with notes saved in a document.

    It reminded me of myself when I’m trying to fix something on the ranch I’ve never done before. I have to quickly learn what’s wrong, how to troubleshoot the extent of the issue, and decide how to move forward. Those troubleshooting skills are invaluable, and that’s likely the biggest thing my daughter learned. That’s what I think is a struggle for many people, in all fields, but certainly in technology.

    The next time you get a chance to help someone troubleshoot, work with them, explain your process, and help them improve for the future.

    Steve Jones

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

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

  • Reading Blogs: T-SQL Tuesday #204

    This is an interesting invitation this month. Jeff Ianucci is a new host, and also has agreed to start taking over some of the T-SQL Tuesday management. Mike Walsh and StraightPath Solutions will steward this, but Jeff will likely do a lot of the day-to-day (or month-to-month).

    In any case, I hope you support him and more of you participate, even if it’s a post on LinkedIn.

    This month Jeff asks about blogs, which is kind of like a circular reference. Blogging about blogs. Reminds me of GNU.

    In any case.

    The Blogs I Read

    Jeff asks is blogs are still relevant and I’d say yes. They contain information lost in the AI summaries, so I encourage you to read them.

    I run SQL Server Central, and we syndicate blogs here (ping the webmaster if you want to join). I add some of those to the newsletter, and read most of them. I especially love seeing Brian Kelley’s posts.

    The others I read, with a little why, are:

    • Brent Ozar Pro blog – He always has interesting stuff in here, often things I didn’t think about.
    • Ozar.me – makes me think about life. Brent’s personal blog
    • Erik Darling – I learn about performance here. I don’t use a lot, but to me, this is good background to keep in mind as you look at other code, or think about patterns in development.
    • SQL Authority – I see Pinal on X, and when I do, he sometimes a post catches my eye, so I’ll go look.
    • SQL Server blog – I catch up on stuff here
    • StraightPath Solutions – One of the few we don’t syndicate that still updates

    For most of these, I don’t subscribe or read every day. Mostly I catch posts on social media, or while compiling the Database Weekly newsletter, but I find this content more helpful for me to be interested in tech and grow than AI stuff or many random posts.

    Keep blogging, and keep reading blogs. It’s good exercise for your mind, and it’s a great way to improve your communication skills.

  • Planning for Change

    Update: My apologies to Randolph for the incorrect pronouns. They should be correct now.

    Over the last year, I’ve been asked numerous times when I’m plan to retire. This question has come from friends, parents of kids I coach, coworkers at Redgate, and even from Microsoft. A few people have asked about my succession plans for leaving, as I have a public site at SQL Server Central, and the charity in SQL Saturday. I’d like those things to continue past my time, so I am thinking about how to do that. I already have plans to hand off T-SQL Tuesday next year to someone else.

    No worries, I’m not retiring soon. I have quite a few years left, though a decade is probably the outer range for me.

    Randolph West retired from Microsoft, and perhaps from tech. We’ll see, and I hope Randolph’s writing efforts go so well that they make that a new career. I love reading, and we always need great writers. I wish Randolph the best and hope their endeavors are successful. However, I’m going to miss Randolph, as they have made the SQL Server docs so much better, and we’ve corresponded about my PRs many times over the years. I have a hit-and-miss acceptance rate, and often, Randolph made my edits better.

    In any case, making a big change in your life is hard. Whether this is career or personal, I’ve seen many people struggle with big changes. I’ve seen many, many more people be afraid to make a big change, often wishing they could but continuing along their current path anyway. That continuation often involves a lot of stress and many complaints, which is why I constantly advise people to make a plan, build their skills, and then make a change.

    Whether you’re planning for retirement, a new job, or even a vacation, it pays to ensure your world is set for someone else to take over. Even if you don’t leave, having things organized, scheduled, planned, maintained, etc. makes your job easier every day. This doesn’t mean everything is automated, though automations are helpful. Routines that are documented, protocols that catch and handle exceptions (automated or not), clean boundaries between tasks, even clear communication- these are the things that ensure that your job runs smoothly. Often we create these habits that we internalize and (mostly) consistently execute, but we could be better and smoother with a little effort. Especially with AI agents (helping and watching, with approval, not doing all the work independently).

    I saw someone say recently that it’s not just death and taxes that are inevitable. Change is also something you can count on. I think working with the idea of change helps us prepare for it, whether it comes sooner or later.

    I’m working on setting up continuity for the things I want to live past me, which are both inside of work and outside of it. Especially things for my family, where I want to document how things around the ranch work in case they need to take over.

    Steve Jones

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

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

  • 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.