Category: Blog

  • Daily Coping 14 Oct 2022

    Today’s coping tip is to look for the good in people around you today.

    I’m working remotely today in New York. I flew up last night to be with my daughter, and it’s my 19th trip of the year. Yes, I spend a lot of time in airports.

    Travel has been more of a hassle this year because of staffing and schedules. It has gotten better for me over time, but things still seem to take longer than in 2019.

    Many businesses inside airports are busy. Not enough staff and lots of customers. Sometimes not enough supplies. However, I think most people are doing the best they can. I have learned to assume employees are trying to help and think they are making their best effort.

    I also find lots of people are understanding and tolerant of delays and supply issues. The process can be annoying, but it seems to me the relatively rare person that isn’t acting “good” overall.

    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 13 Oct 2022

    Today’s coping tip is to remind yourself that things can change for the better.

    It can be easy to get upset/sad/depressed/angry/etc. about the way something is in the world. Whether personal to you at home or work, or perhaps with the general state of the world. I know the latter affects a lot of people these days with the crazy way mainstream and social media latch onto certain issues.

    I have usually been an optimist, and I believe in the human spirit. I also think I can often influence how things go for me with hard work and effort. I say that because I’ve been able to do that in the past.

    It’s a good reminder to me to stop and think about this. I know that my schedule sometimes creates stress and concerns for me, but when I stop and think about the things I’ve learned to do to help cope, the success I’ve had in catching up with work, and the way I have started to more mindfully build a schedule, I know things get better, even when they’re hard.

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