Daily Coping 15 Apr 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 make sleep a priority and go to bed at a good time.

I don’t always do this, and sometimes I find myself waking up and spending too much time at night reading rather than trying to go to sleep.

I’ve cut down alcohol consumption quite a bit this year, and it has definitely helped my sleep. This week is a short week for me. I worked on chores last Saturday, coached all Sunday, and then had a busy 4 day week before traveling to Chicago Thur afternoon. Today I’m coaching, and we likely won’t get done until late.

To prepare for this weekend, I made sleep a priority this week. Sunday I was tired, as was my wife, and we both fell asleep around 9-930p. A bit early for us.

Monday I had yoga at night and made it a priority to call it a night by 10. Tuesday I did the same thing, but Wednesday we had an evening practice until 9, so by the time we closed down and drove home it was 10. That was closer to a 1045 night.

Not bad, but not great. However, it was helpful to make sleep a higher priority and try to end my day earlier.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 15 Apr 2022

Daily Coping 14 Apr 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 give your body a boost by laughing or making someone laugh.

I was in Las Vegas a few weeks ago and went to a comedy show. My wife and I enjoy comedy and thought it would be a good night out with friends.

It was bad. Not the worst show, but probably top 2 or 3 bad ones. I can’t believe the headliner was on a marquee outside the MGM.

I didn’t laugh that night, but I decided to do something different when I made this tip. Instead of music or the radio when I ran errands, I decided to put on my Pandora comedy station. I have one built from Ricky Gervais, Greg Giraldo, and Dave Chappelle. I even kept it going with headphones while in the store.

I laughed in the car out loud, and smiled in the store.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 14 Apr 2022

When to Use Zero

I’m not great at building charts and graphs. I can build a basic chart, but I often depend on the tooling I use to size, scale, etc. appropriately for whatever I’m graphing. That, or I just use a basic graph that starts from zero and has some sort of linear scale. Or I just present a table of numbers.

There are plenty of misleading charts, especially used by the media that want to show some particular aspect of data that suits the story they are reporting. Many of these misleading charts often don’t start at zero, and they end up scaling in a way that can confuse people.

You wouldn’t think it was hard to decide whether or not to scale a graph of data from zero or not, but it can be complicated, as this post shows. There is a flowchart to help you decide when to include zero, or even when to have an inset chart that better explains the data. As many of us know, it can be easy to misinterpret data, especially when someone else is deciding what to show.

In this case, the post talks about some examples of when the data doesn’t graph well because the scale is too large and the range of data too small. Or when the scale distorts the relative size of two values in a graph. In all of the examples, it makes perfect sense why you do or do not include zero on your axis, but I don’t know that I know when I should or shouldn’t do this.

Part of the problem for me is that people often glance at visualizations and charts without spending enough time to really study them. That’s part of the idea of a visual, in that we can get information quickly from a picture, as opposed to a chart of numbers. However, it is still easy to look at a broken scale or inset chart and not spend the time to comprehend that one value isn’t twice another, but instead realize the chart is zoomed in because the scale changed. There isn’t a perfect way to present information, but there are ways that might work better.

To me, a lot of misunderstanding gets cleared up when we discuss the chart and the data in a group. Often one person will realize when others are not reading the scale when drawing their conclusions and remind others that Canada isn’t twice as large as Brazil. That works if people speak up and if others listen. That isn’t always the case, especially when the boss is making a mistake. The other issue is that many of us might look at a chart by ourselves. and we are unlikely to tell ourselves we are misreading the values.

There isn’t a good way to ensure people read a scale and factor that into any decision they make regarding the chart. I do always like to include some data with a visual, that way I can see raw numbers on the same report, or by drilling in. The combination works well for me, but I’m a geeky, numbers person. I like seeing data, which is why I like working with databases.

Steve Jones

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

Posted in Editorial | Tagged | 1 Comment

Ensuring SQL Compare Checks Synonyms

I was running a PoC for a customer and they noticed that synonyms were being missed when they changed the database being used. It was surprising to me, but it turns out the solution is simple.

This post explains how to fix this.

This is part of a series I have on SQL Compare from Redgate Software. It’s an amazing piece of software that you should try if you haven’t. Download an eval today.

The Scenario

Imagine that I have a synonym in my database. In the development environment, I have this pointed to one object, but in production, it will be pointed to a different object. The name of the object is likely the same, but the server (instance) name or the database name might be changed. I see this all the time where I might have these databases in my dev environment:

  • Sales_Feature
  • Finance_Feature

In Sales_Feature, I have a synonym pointed to Finance_Feature, which works most of the time.

When I get to production, I have “Sales” and “Finance” databases. I need the synonym pointed to Finance, even though I might take code from these dev databases and commit to version control. There’s certainly a development challenge here in this scenario, but let’s ignore this. Let’s just assume we want to determine that we’ve actually made a change here.

In my scenario, I’m going to look at Dev and Prod, though on the same instance. I’ll create a synonym in one database that points to a different database. Here’s a quick set of test code:

USE [SimpleTalk_1_Dev]
GO
CREATE SYNONYM dbo.MyTable
FOR Compare1.dbo.MyTable
GO

Now, I’ll create a similar synonym in another database, but pointing to a different location. Think dev and QA here.

USE [SimpleTalk_5_Prod]
GO
CREATE SYNONYM dbo.MyTable
FOR Compare2.dbo.MyTable
GO

If I run SQL Compare, the differences are shown here:

2022-03-30 16_01_33-SQL Compare - New project_

There is no difference. Clearly the synonyms are different, but why don’t I see them?

The Solution

It turns out that SQL Compare assumes you might have these pointed to different instances or databases when moving to production from development. It assumes you only care if there is some other difference.

If I edit the project options, I can see this. When I click the “Edit project” and go to the Options tab, I can scroll down. I’ll see the “Ignore database and server name in synonyms” option checked by default.

2022-03-30 16_03_33-New project_

If I uncheck this and then run the compare again, I see this:

2022-03-30 16_04_34-SQL Compare - New project_

Now I see a difference in the two databases. This also works if you have two different instances and the same database names, which is a more common occurrence.

This same option applies in all our products that use the SQL Compare engine, so SQL Change Automation, SQL Source Control, Flyway Desktop, and the various automation components, all of which are in the Redgate Deploy. If you find your synonyms aren’t being deployed, make sure you have this option unchecked.

If you don’t have any tools to help manage database development and deployment in a DevOps way, download a trial.

Posted in Blog | Tagged , , | Comments Off on Ensuring SQL Compare Checks Synonyms