Author: way0utwest

  • Friday Flyway Tips–Dark Mode

    I saw a post that Flyway Desktop has a dark mode and I had to try it out.

    I’ve been working with Flyway Desktop for work more and more as we transition from older SSMS plugins to the standalone tool. This series looks at some tips I’ve gotten along the way.

    Dark Mode

    In general, I’m not a big dark mode person. I tend to use browsers in light mode, like this:

    2024-02-07 15_17_17-SQLServerCentral – The #1 SQL Server community

    I regularly work in VSCode, which is light for me.

    2024-02-07 15_17_28-SQLSat1076.yml - sqlsatwebsite - Visual Studio Code

    And of course, SSMS is light. I know lots of people have wanted a dark mode, and you can configure that, but it’s a mess. To me, I just like light mode.

    2024-02-07 15_18_10-SQLQuery9.sql - ARISTOTLE.DMDemo_1_Dev (ARISTOTLE_Steve (55))_ - Microsoft SQL S

    However, someone posted a note internally a Redgate thanking engineers for dark mode.

    Wha??? I had to try it.

    It looks interesting.

    2024-02-07 15_20_57-Flyway Desktop

    I don’t know if I’ll use it, but it’s easy to enable, and I can switch anytime. In the top bar, there are a number of icons. There’s a moon for one, which you see above and below, because I’m in dark mode.

    2024-02-07 15_21_45-Flyway Desktop

    If I click the left-most one above, I see this:

    2024-02-07 15_22_05-Flyway Desktop

    Now I have a sun, and a light mode.

    2024-02-07 15_22_18-Flyway Desktop

    This works on all tabs, on the VCS blade, and it gives you the option to work with either a white or dark background.

    That’s pretty cool. I don’t care so much, but I know lots of people do, so they now get the option.

    Try Flyway Enterprise out today. If you haven’t worked with Flyway Desktop, download it today. There is a free version that organizes migrations and paid versions with many more features.

    Video Walkthrough

    I made a quick video showing this as well. You can watch it below, or check out all the Flyway videos I’ve added:

  • Do You Have a Jeff?

    In the Phoenix Project (worth a read), there is a character called Brent, who is to go-to person for everything in IT. I don’t know if this character was modeled after Brent Ozar, but I always picture him when I re-read the book, and I suspect he was that person in previous positions. I’ve been that person as well, and it’s both exciting, fulfilling, and very stressful. At Redgate, that person has been Robert C, who is my go-to person for many questions.

    In the DBA world, I think of Jeff Moden. He’s been a prolific and incredible author over the years on many things SQL-related and is a huge proponent of others learning to write better code and better utilize the database platform more efficiently. I suspect in his company, he is the go-to person for most database-related questions and problems. I also suspect he solves most of them very well and has the influence (or power) to effect change.

    However, are you Jeff in your organization? Do you have a Jeff? In many of the customers I work with, there is no Jeff. Sometimes there are very smart people, but they cannot effect change. Or they don’t know how to go about making change happen. In other companies, there isn’t anyone who is an expert on the database or related technologies. Too often, I think people aren’t often aware of what expert really is and they just do the best they can without knowing if it’s a great job or a poor one. That’s my opinion, but it’s based on decades of experience (and success) working with lots of others on database code.

    The good news is that most of you can learn to be Jeff. You can work to improve your skills, both technical and interpersonal (soft), to raise the quality bar at your organization. Maybe you can get more work done and get a huge sense of satisfaction from your job (and a raise). Maybe you just want to get things done more efficiently and get away from work more often.

    There are many ways to do improve the quality at work, but essentially the idea behind platform engineering is to produce tools that make developers and operations groups more efficient. The goal is to get more work done, easier, reducing the cognitive load on everyone involved with software. Not because they can’t do the work, but because we want them focused on their specialty. Whether that’s writing C# code for an application, writing zero downtime database changes, or making beautiful reports. The hassles of actually capturing and moving code should be something provided by a platform. A person can do some of this by sharing their knowledge, not just in conversations, but providing templates, models, standards, and other code elements that might help their co-workers become more productive.

    DevOps is about producing code quicker, reliably delivering that to the customer, and raising the quality bar (don’t forget this) and platform engineering is the next evolution here, where the tools, process, and flow are set to make the implementation of DevOps easier for most developers and DBAs. Even if your organization doesn’t want to produce a platform, the idea of building and deploying tools (samples, models, snippets, etc.) to make someone else’s job (or yours) easier and smoother is something we all can do. We can all aspire to be Jeff and get there with a little investment in our skill across time.

    Steve Jones

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

  • A New Word: Wellium

    wellium – n. an excuse you come up with to rationalize a disappointing outcome – telling yourself that you weren’t in the mood for that sold-out show anyway, that your safety school is actually a better fit, that your dream job might have been too stressful.

    I come up with wellium all the time. I think it’s a very human reaction to try and make yourself feel better with some justification of why you are OK something didn’t work out.

    As I’ve gotten older, I do try to just feel bad or disappointed, and then move on. I tell myself that often decisions made by others aren’t necessarily a rejection. Often it can be a preference for something else, or the competition was better.

    It’s OK if others beat you at something if they’re better. That’s what we all want from competitive situations in sports, in jobs, in music. If they win, they win.

    Hopefully that also spurs you to learn to be better.

    From the Dictionary of Obscure Sorrows

  • Using the T-SQL Error Functions–#SQLNewBlogger

    I was working with a customer that was doing some error handling in procs and helped them do some error tracking. As we were working through things, I realized that some of functions working with errors operated differently than I expected.

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

    The Error Functions

    There are a number of error functions available to you in modern SQL Server. We have:

    All of these functions have the same clause in their docs, which says, “ xxx returns NULL when called outside of the scope of a CATCH block.”

    That was something I didn’t realize. I’d assumed I could run this:

    SELECT 1/0
    SELECT ERROR_SEVERITY(), ERROR_MESSAGE(), ERROR_STATE()

    However, if I run this, I get the error, but my results are NULL, NULL, NULL.

    If I want the values, I need to do this:

    BEGIN TRY
       SELECT 1/0
     
    END TRY
    BEGIN CATCH
       SELECT ERROR_SEVERITY(), ERROR_MESSAGE(), ERROR_STATE()
    END CATCH;

    This will return my 16, Divide by zero error encountered., 1

    In general, you ought to be using TRY..CATCH blocks for error handling. We do want to ensure that we are doing our best to deal with problems in code and not just expect all errors will be managed by the application. As much as possible, we should try to gracefully fail and give the application or client something useful.

    Along with TRY..CATCH, learn to use THROW, and ensure you’re adding some error handling to older code. This is an easy refactoring add to existing code, and it’s simple to enhance future code to make it more maintainable.

    SQL New Blogger

    This is a quick look at the functions that capture error information, and noting a limitation I didn’t realize. It’s short, simple, and took me about 10 minutes.

    This is one of those topics that dev managers, especially front end based ones, appreciate. Doing a post on this topic on your blog might get someone to ask you about error handling, and with a little practice (and a few posts), you’ll be able to talk about this topic confidently.