Daily Coping 15 Jul 2020

I’ve 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.

Today’s tip is to find an action you can take to overcome a problem or worry.

I have plenty of small problems, and mostly small worries. However, I recognize and appreciate how lucky I am with family, health, security, especially compared with many in life.

As a result, I try to keep things in perspective. One of the concerns I do have is contributing to a growing number of cases in the US. I have started coaching again as Colorado looks to open up, but I’m still worried.

I’ve tried to think about how to be more careful, avoiding talking directly at someone, wearing a mask more often, keeping my hands and equipment clean. It’s not perfect, but there are things I can do in my control to try and be more careful.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 15 Jul 2020

Setting up a New SQL Change Automation Project

It’s been awhile since I’ve set up a new project in Redgate’s SQL Change Automation project. I’ve mostly used this in Visual Studio, but I need to demo something to a client, so I decided to document the process of getting started here.

There are often updates to this product, as we release every week or two, so the first thing was the click on the banner in SSMS and upgrade to the latest version. Once you have things working, you don’t need to do this often, but you should to it quarterly at least.

2020-07-07 18_00_55-SQL Change Automation

My Environment

I’ve got multiple copies of my databases on one instance. I have 1 for development, 1 for QA, and one for Prod. This is a good PoC setup for getting familiar with the product.

2020-07-09 10_13_51-SQL Change Automation - Microsoft SQL Server Management Studio

The flow is we only make changes in SimpleTalk_1_Dev with SSMS. Everything else will happen through automation.

These databases already have objects in them, but they’re not overly complex.

2020-07-07 17_56_15-SQLQuery1.sql - ARISTOTLE_SQL2017.Sandbox (ARISTOTLE_Steve (54)) - Microsoft SQL

I have SQL Change Automation (SCA) installed in SSMS, versions 4.2.20176 and 18.5 respectively. Let’s see if we can do some development.

Creating a Project

When I open the SCA tab in SSMs, I see the open and new project options.

2020-07-08 10_22_54-SQL Change Automation - Microsoft SQL Server Management Studio

We are creating a new project here, so let’s click the button to do that. Once I do that, I get a dialog that appears. I’ve entered a name and then select my folder where I keep code.

Note, I’ve picked a folder name here, and the project will create a subfolder under this with the name of the Project as the folder name. In this case, my actual project files will be in E:\Documents\git\SimpleTalkDemo\SimpleTalkDB.

2020-07-09 11_24_25-New project setup

I do want the project folder under version control. Before I have SCA do anything, I use a command line and initialize this for git. If you don’t know how this works, I’ve got a post on that.

2020-07-08 19_41_49-SQLServerCentral – The #1 SQL Server community

Now I can go back and connect to the development source. This is the dev database. There doesn’t need to be anything in here, but in this case, it’s a copy of the schema from production. Once I enter the credentials and pick the database, I come back to this screen and I see the first part of my project.

2020-07-08 19_43_53-New project setup

Clicking Next gives us the filter screen. This uses the filter files from SQL Compare to determine which objects we are including for development purposes. For most projects, we don’t filter anything. We want all objects to be included in our project.

2020-07-08 19_44_00-New project setup

I’ll leave this alone and click Next. The last screen is the baseline screen. This allows me to set a baseline or not. A baseline is a view of what the target database looks like right now. In this case, this is the production database.

This process will look at the objects in that database and create a script that builds up a base database to the same state as production right now. That is useful because all items we add to this project depend on the state being this way. You can read more about baselines in the documentation.

2020-07-08 19_44_07-New project setup

I will configure this to connect to my production database and once that’s correct, I’ll click “Create” to set up the project.

2020-07-09 11_26_26-New project setup

The project gets created fairly quickly, and once it’s complete, I get a summary. As you can see below, the project was set up and there are some notes about what was done.

2020-07-09 11_27_07-SQL Change Automation - Microsoft SQL Server Management Studio

You can see that one migration script was generated and this was for my baseline. This contains all the objects in my current production database, which won’t be deployed unless I have an empty database, like a CI database.

There were also 19 programmable objects, which are views, functions, and stored procedures. These are items that we don’t want to track each change to, but only the state at a point in time.

All of this is reflected in my project folder, which you can see below. There are subfolders below some of these for the various object code.

2020-07-09 11_30_14-SimpleTalkDB

I’ve got a new project. Now I want to commit this to version control first, and then I can start development work.

2020-07-09 11_32_04-cmd

If you’ve never worked with SQL Change Automation, download an eval and give it a try today. I’ll be documenting the process as I build out a demo for a customer, and you can follow along.

Posted in Blog | Tagged , , | 1 Comment

T-SQL Tuesday #128–Learning From Others

tsqltuesdayIt’s the second Tuesday of the month and time for T-SQL Tuesday again. This month I’m grateful that Kerry Tyler is hosting. I had the pleasure of sitting with Kerry and his wife at a SQL Saturday last year before the world locked down and presented travel. At the time I was looking for hosts and pressured a few people into agreeing to host a month.

This month Kerry wrote an interesting invite based on his passion with airplanes and flying. Mistakes and errors with planes can be catastrophic, so they are always revisiting issues and learning from others. He asks us to do the same this month.

Root Cause Analysis

One of the things that we talk about in technology is analyzing incidents and failures to determine a root cause. Despite the talk, relatively few places I’ve worked in actually perform a root cause analysis and produce actions that are taken into account in future protocols, processes, and documentation. Too few people perform a blameless postmortem, which is what we need more of.

And too few companies share their learnings publicly.

I can’t change that, but I can think forward.

DevOps

I talk a lot about DevOps and work with companies to transform what they do. This is part of my job, but it’s also an area I have passion in because I’ve worked in organizations that were following the tenets of DevOps before the term existed. A couple of areas where I learned from others to build better systems for the future.

Networking is something that relatively few of us deal with as technical professionals. Since DHCP became a very solid platform and the amazing growth of wireless, we don’t need to dig into networking most of the time. However, understanding how DNS works and the networking protocols is still relevant.

I was fortunate to work with a talented network engineer at one company. We were having issues with a client being able to connect to our database server, and he managed to show us how the DNS records were different between our office and theirs, when working across a VPN. Since then, I’ve always learned to check simple things, with tools like nslookup, to verify a client can see a server.

As a data professional, I know backups are important. I use BackBlaze at home, but at work I often deal with a variety of products, even with SQL Server. While the backup process has been very consistent and stable in SQL Server, we’ve had different options emerge, as well as third party products that sometimes deal with backups in a different way. I’ve often insisted on verifying that we can restore databases to a point in time, precisely because this is what will be required during some DR incident.

Over the years, many people have helped me understand how their product or system worked, too many to name, but I’m grateful for those that have helped explain to me exactly how a particular backup or restore process works and helped me validate the process to recover data.

For the most part, I’ve just been the one pushing to ensure documentation was captured and available for others to use in the future.

I do try to give back and teach others as well. I’ve been writing about Version Control Systems, including some basics I’ve learned over the years. Sometimes by reading a tutorial or blog, sometimes by making mistakes and trying to work through documentation. My learnings from others inform most of the content I produce to teach you, so it’s not that I’m doing anything innovative; I’m translating the lessons from others and myself for you.

We all learn from others. We stand on the shoulders of giants and of ordinary people. Remember that, continue to learn, and help others where you can.

Posted in Blog | Tagged , | 1 Comment

Renting Features

The licensing, use, and ownership of software has been quite a contested topic for years. Many people have assumed they “own” the copy of Quicken or Halo that they bought, but modifying or even reselling the bits has been a contested right by many vendors. It seems that courts seem to lean towards the perpetual rental of those bits rather than ownership.

We’ve gotten used to that in software, but what happens when this extends into the real world? There is a piece at Ars Technica about BMW looking to “unlock” features on their cars if owners want to pay for them. These are things like heated seats or perhaps sports suspension that are installed, but not activated. You could subscribe to the feature on a trial basis, and then activate it for a year or two if you wanted to pay a fee. The interesting thing here is that you could even do this with a secondhand car.

The comments from many people are disparaging, and rightly so, since so many vendors have looked to make money with these options, often in a way that isn’t quite fair for the consumer. There is certainly concern and outrage about the cost of these features if they can be installed in every car without payment, and there are weight/fuel considerations as well. While heated seats might not use more fuel, I’d assume something like adaptive suspension or extra speakers in a sound package do reduce mileage.

In some sense, I do understand this approach. I’ve purchased computer hardware with extra CPU and RAM that could be “rented” for a short time, or purchased. In the case of a car, I’d like to be able to “purchase” heated seats forever with a similar charge to what I’d initially pay. Or maybe a rental makes sense if this includes a warranty while the item is rented. Certainly being able to turn this on later on a secondhand car would be great. There’s also the idea that you could turn off a feature you didn’t like and stop paying.

I also understand the cost structure here. If every car is built the same, the costs of manufacturing go down, even if there is some loss on a percentage of customers not using the feature. If too few turn this on, I’m sure BMW (and others) abandon the idea. If enough do, I expect we’ll see other features, especially the electronic ones, being added to the list of options.

Ultimately, the use of software to lock features, and unlock them, makes sense in some cases and not in others. The devil is in the details, and certainly I think companies need to tread carefully here, ensuring they are pricing the options in a fair way. I also think they need to account for perpetual ownership as one of the options.

Cars are notoriously modifiable, and I do think this will succeed. I’m sure there will be jailbreaks and unlock codes available all over the Internet, but I’m not sure this will stop vendors from renting features. There are ways people can modify iPhones already, though I’m not sure most consumers care.

Steve Jones

Listen to the podcast at Libsyn, Stitcher or iTunes.

Posted in Editorial | Tagged , | Comments Off on Renting Features