Author: way0utwest

  • Daily Coping 4 Mar 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag. 

    Today’s tip is to actively listen to what people say, without judging them.

    This is a challenge, especially while being remote from everyone. I see many people in meetings looking around, typing, checking phones, etc. Maybe not that different from some in person meetings, but it does feel often that people aren’t getting engaged.

    I’m trying to do better. Yesterday I wrote about listening more to my daughter. Today I have been trying to do better with work meetings. I’m trying to listen more to others, focus on what they’re saying, not getting excited or upset, and absorbing their words. I’ll think about it and then give feedback on how I feel this works best for the organization or a wide variety of people, not just myself.

  • A Quick Break and New Adventure

    I’m gone for the next three days, heading to Crested Butte, CO to ski. I enjoy skiing and this is the time of year I try to use vacation and get out with my wife.

    We’ve been missing travel, and missing skiing. Some of our efforts recently haven’t gone great, though our place is Keystone is starting to get rentals. That’s a good sign. Since using our place would reduce our revenue, we decided to try a new place and just book lodging.

    We’ve never been to Crested Butte. When I checked lift ticket reservations, they were available, and there was a lodging sale. So we decided to book a few days up there.

  • Daily Coping 3 Mar 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag. 

    Today’s tip is to make uninterrupted time for your loved ones.

    I have less of these now, with all the kids away from the house. However, my daughter has called a few times to chat. Often she takes time between classes, or shortly thereafter, but those are not always good times for me. I’m often working then.

    However, I’ve made it a point to stop, not multi-task, and walk away from my desk when she calls. Focus on her, and enjoy the time.

  • Using Dynamic SQL

    There are many ways that you can structure your T-SQL code to solve complex problems. Throughout my career, I’ve learned different ways, and also some patterns to avoid. However, those change over time. For example, there was a time when heavily loading tempdb caused issues in the v6 era. As a result, I tried to avoid using them. These days, I’d consider them a good option to think about.

    One of the techniques that I see people trying often is Dynamic SQL. This is where you don’t write the code directly, but you write code that will put together a string of code to execute, and then you call this with EXECUTE() or some other mechanism to get your results.

    There are places where you might find Dynamic SQL useful. I saw an article from Erik Darling recently that gives you some situations where Dynamic SQL can help. These are often situations where performance is worse with a bunch of conditional code that is jumbled together. Separating out code into different procs or functions can help here, but that becomes a maintenance headache in many ways.

    Dynamic SQL isn’t something to just try without thinking carefully about the ramifications. SQL Injection is a real concern, though you can mitigate the risk with some careful coding. However, you need to be careful how you structure code, and don’t just concatenate strings together and execute them. Read up on good practices from others, and ensure you test your code thoroughly. In fact, this is one place where automated testing can become important, as you learn of different injection techniques, you can add new tests to ensure your code isn’t vulnerable.

    As you work with T-SQL, it’s important to continue your education, learn how the platform and language work, how performance changes between versions, and what options are to be adopted or dropped. Becoming a better T-SQL developer takes work and practice, and it’s an area in which we should all be constant students.

    Steve Jones

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