Daily Coping 20 Jan 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 healthy food that nourishes you today.

My wife has been on a bit of a diet, actually a few through the last half of 2021. After nearly two years of pandemic life, in which I gained a good COVID fifteen, I decided to join her. It’s a simple set of meal plans that have me eating better, and less, which is the most important part. Mostly it’s a routine of days where I have:

  • small breakfast – either low or medium carb, depending on the day. sample, two eggs and two slice of turkey bacon or oatmeal with blueberries
  • mid morning protein smoothie – usually a little protein powder, some frozen fruit and water/ice. It’s not a great smoothie, but it quells some hunger.
  • smaller lunch – usually a salad or wrap
  • mid-late afternoon protein smoothie – usually a little protein powder, some frozen fruit and water/ice. It’s not a great smoothie, but it quells some hunger.
  • mid-sized dinner – low or medium carb, which has been chicken with vegetables or turkey tacos (limited shells).
  • an apple or similar snack some evenings.

Today is a low carb day, so eggs and bacon, a couple smoothies, salad with chicken, and chicken with vegetables. It’s not that satisfying, but nearly two years of indulgence has me trying to pay some penance back.

Also:

  • No alcohol (since Dec 31)
  • No cream in coffee
  • Limited diet soda (I need some indulgence)
  • No dessert
  • No pre-packaged food, other than the oatmeal.

I feel better, and I’m losing some weight, which is the point of all of this.

Posted in Blog | Tagged , , | Leave a comment

Creating a new User-Defined Data Type–#SQLNewBlogger

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

I ran across a question on user-defined data types, which I hadn’t worked with in a long time, so I took a minute to investigate. I wrote this post about an interesting language item.

User-defined table types let you add a new type that can be used anywhere you would use a base, or normal, data type. This means if I want to have a type of US zip codes, perhaps limiting the base zip to 5 numbers, I can create a type that is limited to 5 digits.

If I want to create a new user-defined table type, I’d have thought I did something like this:

CREATE TYPE dbo.USZipCode AS VARCHAR(5)

However that doesn’t work.

2022-01-06 10_20_55-SQLQuery1.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (58))_ - Microsoft SQL Server

The AS structure is used in many places, but not here. Instead, we use a FROM structure. This means I’d do this:

CREATE TYPE dbo.USZipCode FROM VARCHAR(5)

This gives me a type I can use in CREATE TABLE statements, stored procedures, and more. Anywhere I’d use the varchar(5), I could do this instead:

CREATE TABLE dbo.AddressTable
( AddressID INT NOT NULL
, AddressValue VARCHAR(100)
, AddressZip USZipCode
)

This let’s me use a type that is more intuitive, I guess. I don’t find these that useful in most places. In fact, it’s a little confusing. If I were a new developer, is this a 5 or 9 (or 10) digit field? Is it numeric or string? It’s not easy to determine this. I don’t find these that useful.

SQL New Blogger

I was doing other work, but I saved a bit of code and then spent about 10-15 minutes to write up this post. This one shows less about what I learned, and more about what I think.

Always good to show to a prospective interviewer.

Posted in Blog | Tagged , , | 2 Comments

Most of Us Are Vulnerable

I saw this study recently, where most people think they are better-than-average drivers in the US. I thought about it myself afterward, and I think I’m maybe average. I do pay attention most of the time, I try to be more careful when it’s wet or snowy and give myself more time to slow down. I  try to be aware of the other cars and obstacles on the road. I also usually have a drink (coffee, soda, water) with me, and I certainly mess with the music player. The Tesla reminds me constantly when I’ve strayed near a line, so a few months of driving seems to tell me I’m not great. Certainly not above average.

I would expect that most of us think we’ve done a good job with security for our systems.  We don’t expect to get hacked or deal with ransomware. I don’t know how realistic that is, as a recent set of penetrations tests shows the vast majority of networks are vulnerable.

It sounds bad, and it is. It also is not likely to change as the complexity of many networks is high. There are so many devices, constant additions and changes to services and applications, and regular requests to grant access to a new group. It’s amazing there is any security at all, given how quickly people want to access systems and how impatient they are when they can’t connect.

The data doesn’t show that every system is wide open, but there are ways in which every network can be disrupted. Whether this is significant or not is hard to assess, but given the reports I see in media, as well as private notes from friends, I suspect that most companies have plenty of work to do.

It’s not all had work, however. I think many people that configure networks are careful and are wary of opening firewalls. The bigger problem, which continues to exist, is likely simple passwords from far too many people. That, combined with a lack of multi-factor authentication being rolled out, means that there a lot of simple changes that could make a big difference. I know my company rolled out a corporate password manager recently to all employees. This, combined with our MFA app on mobile devices means that we should have strong passwords and better verification of legitimate access for most systems.

At least, I hope we do.

Steve Jones

 

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

Posted in Editorial | Tagged | 2 Comments

Daily Coping 19 Jan 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 connect with someone near you, share a smile or chat.

One of the things I learned early in life is that being friendly isn’t hard. Waving, smiling, saying “hi”, aren’t things I always see in the city, but in suburban and rural areas, this happens more.

I also find myself being a little annoyed with myself if I’ve made eye contact and not been the first one to be friendly.

I had a massage recently, and the masseur wanted to talk, so I engaged and spent time getting to know him. I smiled, looked at him (as best I could), and listened to his thoughts. It was an interesting discussion, and even when I might disagree with something, I resisted an impulse to argue and instead just kept a pleasant chat going.

Surprisingly, I enjoyed the hour.

Posted in Blog | Tagged , , | Leave a comment