Category: Blog

  • Daily Coping 16 Mar 2022

    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 have a no plans day and notice how that feels.

    Incredibly hard for me to do this. I really, really struggle. How so? A little story.

    After a volleyball tournament recently, an all day (5am wakeup, arrive by 7, busy until 330p), I got some food and drove home. I got home around 530. As I was close to home, my wife noted that the generator outside wasn’t working right and she was hoping to do a training session with a horse. Mind you, she was with me all day and then needed to go pick up this horse.

    I was looking forward to unwinding at night, play a little guitar and rest. Instead, I got out there, dragged a second generator out there, hooked it up, tested lights, then dragged the old one in. I stood in the barn reading for about 20 minutes until she arrived. I explained how things were working, then went inside.

    I could have told her we need to let this go for a day, but I didn’t. I had been somewhat productive coaching during the day, but it wasn’t enough. Not for her either.

    This weekend I’m going to try this on Sunday. We are visiting our daughter in NY, and I’ll work Friday while she’s in class, and Sat we have plans to watch volleyball and go to a TedX talk.  Sunday, however, I’m not making plans. I want to just see how things go, what my daughter wants to do and just flow with the day. No plans, no worries. If I work out, great. If not, no plans.

  • An Amazing Live SQL Bits in 2022

    I was lucky to travel to London last week and attend SQL Bits 2022. This was the first live SQL Bits I’ve been to in 4 or 5 years, and the first one held since 2019. Two years away, but back strong and as wonderful as ever.

    20220308_154035

    The event was at the London ExCel center, which is a large exhibition hall. There were 4 or 5 other events taking place, and the 1,000+ SQL Bits event was in less than 1/10th of the space. Still, a large space that reminded me of what a large conference is like.

    The event hall was a large space, surrounded by curtains, with booths in the middle and around the edge. The Community Zone was a section near registration that had some benches, large pillows, and of course, an arcade machine. Various people were hanging out here all week.

    20220310_155801

    The “rooms” were spaces that were curtained off with large screens, stages, and seating that was separated out with tables and space. Overall, I liked the room, though there was a low rumbling of crosstalk from other sessions. Not so loud that it felt like I was listening to two speakers, but more there was a lot of ambient noise, and I had to focus on my speaker. Applause was a bit loud.

    I saw lots of friends. Here’s my Kevin Kline shot, adding to my collection. I’ve seen Kevin at events all over the world for the last 20 years and it’s always a treat.

    20220309_170526

    I also ran into John Morehouse and many others. I didn’t end up taking as many pictures as I would have liked. A sore wrist and a phone stuck in the wrong pocket had me rarely taking it out.

    20220310_152609

    The Friday keynote was a Community one, which I really liked. Rob Sewell and Ben Weissman hosted and asked a number of us to pick our favorite feature in the data platform.

    20220311_085804

    I had my moment on stage and someone got a nice shot.

    FNjx3JUWUAAcFQT

    Both keynotes were live in one of the 12 rooms, but broadcast to the others. That meant that there wasn’t a large space where everyone had to go to in order to watch. They could go to session rooms and see the keynote. I like this idea, and would like to see it at more events. Requiring a large space is hard, and expensive.

    One thing I like about Bits is lots of breaks, with time between sessions to walk around, see people, get coffee, etc. Some events seem to have everyone running from place to place, but Bits is more relaxed.

    Speaking of relaxing, I was wiped out by Friday afternoon. I spent a good portion of time relaxing in the main expo hall, talking with Redgaters and others.

    20220311_180820

    London is an amazing city, one of my favorites, and I had a couple nice dinners out with Brent Ozar. Here’s one with Erik Darling and his wife. Wonderful times with friends that I’ve missed the last two years.

    20220308_193631

    The party Friday night was a fun affair. I liked that some food and refreshments were in the expo hall, which was quieter. A smaller space behind there was the louder party with music, games, and dancing. Not quite my style, but it was nice to see people having fun. I had to fly Saturday morning, so a quick photo with Grant and Kathi as I was leaving.

    FNotaEAWYAIgYyW

    SQL Bits went too quick, and I was sorry that I wasn’t there for the last day. It was a lot of fun, and a sign that people still want to meet in person and conferences will come back. I’m looking forward to future events and hopefully SQL Bits in 2023 as well.

  • Daily Coping 15 Mar 2022

    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 eat mindfully. Appreciate the texture, taste, and smell of your food.

    I don’t do this too often, especially lately. I have a plainer diet, though I am slowing down how I eat and appreciating the few things I do eat.

    However, I was invited to an amazing dinner by Brent Ozar in London and I went out of my way to try and appreciate the food. I’m not a foodie, but I did enjoy the time at one of Gordon Ramey’s restaurants where the chefs are trying to show off.

    This was an oyster. Looks like an oyster, but it was jellied, like a gummi bear or other jell candy. Softer, and quite amazing. I don’t love oysters, but this was something special, with the jellied taste instead of a slimy one.

    20220308_194440

    Roast duck was amazing. The presentation was something, as we saw the whole duck. But then this slice smelled wonderful, and it was tender and full of the duck flavor, with a blend of spices accenting things. The side was turnips, with a turnip puree as a paste. Not a fan, usually, but this was an enjoyable bite.

    20220308_212410

    The fish was great. Cod, but with caviar on it, and potatoes under. The popping of the caviar, slightly salty, with a very tender, flaky fish. Amazing.

    20220308_205704

    There was more, and all of it made for a wonderfully memorable evening.

  • Changing the Owner of a Database #SQLNewBlogger

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

    I had an authorization issue with my account, and I decided to delete it and re-add it. That’s the subject for another day, but before I could delete it, I had to remove the ownership of some databases. You can’t delete a login that owns databases.

    I realized I wasn’t sure how to do this, so I wrote this post.

    A Deprecated Proc

    There used to be a dbo.sp_changedbowner proc that was used, but I know this is deprecated and it shouldn’t be used. It likely would work fine in SQL Server 2019, but I also know there should be more modern code. I decided to look, as I ought to know what is recommended these days.

    In searching around MS Docs, ALTER AUTHORIZATION comes up in the list. I checked, and this allows me to transfer the ownership of a securable, which a database is one of the items in the list. Example F shows what I want to do and uses this code:

    ALTER AUTHORIZATION ON DATABASE::dbname TO [login]

    I can replace dbname and login with the values I need.

    Which Databases?

    I have a lot of databases, and I don’t need to change them all, though I could. In my case, I decided to get a list of databases and owners. If you query sys.databases, there is an owner_sid column. If you join that with sys.server_principals, you can do so on the SID column. This query shows me what I need:

    SELECT d.[name], sp.[name] FROM sys.databases d
      INNER JOIN sys.server_principals AS sp
       ON d.owner_sid = sp.sid

    The results are here:

    2022-02-25 12_34_10-SQLQuery1.sql - ARISTOTLE_SQL2017.master (sa (54))_ - Microsoft SQL Server Manag

    In some sense I hate that “sa” isn’t the default owner, but I get it. There might be a need for other accounts. However, my account is a sysadmin, so my view here is that “sa” ought to be listed.

    I digress. Now that I have a list, I can limit it to my account with a WHERE clause. I can take that list of items and build the code. I could use a cursor, but this is a one-off task, so this works:

    SELECT
                    'ALTER AUTHORIZATION ON database::' + d.[name] + ' TO sa;'
                  , d.[name]
                  , sp.[name]
    FROM
                    sys.databases d
         INNER JOIN sys.server_principals AS sp
             ON d.owner_sid = sp.sid
    WHERE          sp.name = 'ARISTOTLE\Steve';
    GO

    This gives me the code in the results I want to run. I copy paste this and I have a bunch of statements to run. 

    2022-02-25 12_41_07-SQLQuery1.sql - ARISTOTLE_SQL2017.master (sa (54))_ - Microsoft SQL Server Manag

    Despite Grammarly not being happy, this worked fine.

    SQL New Blogger

    As soon as I realized I needed to do this, I knew there were two posts here. One on the removal and adding back of my Windows account, and the second on this topic (when the first didn’t work).

    This took about 15 minutes extra, finding the docs and writing some code, but it’s a good example of where a small situation that occurred helped me find something to write about. Easy for you to take little tasks like this and document your knowledge when you learn something.