Category: Blog

  • Daily Coping 12 Oct 2022

    Today’s coping tip is to start your day with the most important thing on your to-do list.

    I’m writing this on 11 Oct. The most important thing today is the Redgate keynote for PASS, where I have a few sections. We have a prep meeting this morning, so I’m up early, reviewing notes and comments from others so we can discuss this and try to finalize the storyboard.

    The rest of the day will be going back over this and then (hopefully) recording my session for the Summit.

    I started to add a daily coping tip to the SQL Server Central 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.

  • T-SQL Tuesday #155–Using Dynamic SQL for SQLCMD

    It’s that time of month, and I’m the host this month. I wrote the invitation last week and now its’ time to answer. I’m actually using an example from the past that I was reminded of. That was the basis for the invitation as well.

    SQL Slammer

    I don’t know how many of you remember SQL Slammer, but it hit my company, JD Edwards, over a weekend. I was away on holiday, coming home Sunday night and got called into the office that night.

    One of the challenges with JD Edwards was that we used MSDE extensively. It was a part of some of our products, and developers had it on various machines, lots of multi-instances, and in all sorts of development servers. The worm crippled our network.

    We also had non-standard installs, so when we got a patch from Microsoft, it didn’t work because we weren’t in the c:\Program Files\… that they expected.

    I had to some some fancy dynamic stuff to get the patch to work. First, we used some queries in SMS (Systems Management Server) to find all the places where we had MSDE and SQL Server services. This wasn’t too hard, and I had a list of hosts and instances from here. Now the hard part.

    I needed to query all these instances and find out where things were installed, as well as get some patch information back. The SQL itself wasn’t too hard, but connecting to and querying all these machines wasn’t simple. This was the pre-PowerShell  era. and VBScript wasn’t as easy, or bulletproof, to write.

    Excel to the Rescue

    I’d used Excel to help with this type of thing in the past. I would  put in some data in a column in this case, the hosts and instances. Then I’d add the same value in other columns, like SQLCMD. Then I would concat these together to make a string I could run. I also included T-SQL code in here, as I’d be querying various tables inside the engine.

    I also had an output part of the command, so that when I copied the contents of my final column, I had hundreds of SQLCMD command calls that would query all our instances and return data in a way that we could use to run the patch.

    Double dynamic code!

    I put these in a batch file, ran them, and then we had results that could be used in a similar process with the MS patch to patch all machines.

    A long 2-3 day of getting systems patched and slowly turning our network back on.

  • Daily Coping 11 Oct 2022

    Today’s coping tip is to take a small step towards a goal that matters to you.

    I’ve been working on a coaching certification. I don’t really need it, but it will help in the future if I end up changing to a new club or role. I’m trying to take time every few days to work through a video and a quiz.

    This is a good reminder to keep doing that, so I’ll watch one tonight.

    I started to add a daily coping tip to the SQL Server Central 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.

  • Daily Coping 10 Oct 2022

    Today’s coping tip is to write down three things you can look forward to in the next month.

    Easy.

    1. Visiting my daughter. I’m heading up this weekend to watch her play and hang out
    2. SQL Saturdays – Boston and Toronto, exciting to get back to a few events
    3. Open Gyms – Volleyball won’t start for another month, but I have a few gyms I’m hosting for kids that aren’t playing now. Looking forward to seeing them out on the court.

    I started to add a daily coping tip to the SQL Server Central 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.