Daily Coping 12 May 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 a list of what matters to most to you and why.

What matters to me? An open ended question, but here are a few things that sprung to mind.

My wife – she is the most important person in my life and makes life worth living.

My children – I am constantly impressed and proud of them as they make their way in the world as adults. They give me hope for the future.

Andy Warren – My friend, former business partner, and fellow board member at SQL Saturday. Outside of my wife, he has influenced me the most across the last 20 years.

Our animals – Two dogs, multiple cats, and even the horses. Animals change my life and remind me of how amazing, healing, and special nature is.

Redgate – My employer for the last 15 years and a great company. I really hope this is the last fulltime job I ever have.

Coaching – The interactions, the struggles, the successes of working with athletes each year bring joy to my life.

My Health – As much as I struggle with aging and my body aches, I appreciate that I am overall a very healthy individual.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 12 May 2022

Posting Data and Code–#SQLNewBlogger

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

I wrote a SQL New Blogger post recently on running totals and used some images to show data. A reader sent me a note to say it would be nice to see the code that helps put the post together. I thought that was a good suggestion, so that’s this post.

How can you add code and data to your post?

Publishing Code

There are a number of ways to add code to a blog post. Some of the platforms have specific plugins to handle different types of code. There are also some plugins in Open Live Writer, which I use, for code.

I’ve stopped using those.

It’s simpler to me to just use the PRE tag, for selecting preformatting for a set of code. I use WordPress here, and when I added the code used in this post, I highlighted the code and then selected the Preformatted style. This is shown below.

2022-05-03 09_27_25-Edit Post “A Monthly Running Total–#SQLNewBlogger” ‹ Voice of the DBA — WordPres

The PRE tag works well for me and it’s simple. If you want to spend the time configuring code for colors specific to your language, feel free, but I am less concerned about that.

Generating CREATE Statements

For most demo set ups, I create a new table and I copy the code over. For example, I was doing some DDM testing and I made this table.

2022-05-03 10_49_09-SQLQuery1.sql - ARISTOTLE_SQL2017.sandbox (ARISTOTLE_Steve (55))_ - Microsoft SQ

To add that to this post, I’d CTRL+A to select all the code and then copy it. I can paste it below and then format with the PRE tag.

CREATE TABLE [dbo].[DDMEmailTest](
     [MyID] [int] IDENTITY(1,1) NOT NULL  CONSTRAINT [DDMEmailTestPK] PRIMARY KEY ,
     [MyName] [varchar](100) NULL,
     [Email] [varchar](100) MASKED WITH (FUNCTION = 'email()') NULL,
     [Salary] [int] NULL,
GO

In LiveWriter there isn’t a PRE tag, so I just quickly edit the source and add a “re” to the paragraph tags. You can see where I’ve added PRE below, highlighted by the arrow:

2022-05-03 10_50_04-Posting Data and Code–#SQLNewBlogger - Open Live Writer

The other option is to script the table to the Clipboard. I can do this in SSMS easily.

2022-05-03 10_55_23-SQLQuery2.sql - ARISTOTLE_SQL2017.sandbox (ARISTOTLE_Steve (66))_ - Microsoft SQ

I then paste the code into Live Writer.

Note, I usually edit out the USE and SET statements.

Adding INSERT Statements

After the DDL for tables is around, the next important thing for readers is data. If you have the INSERT statements from your testing, then use those. As above, paste those in here.

If not, there are a few options. I have SQL Prompt, so I can select from the table, highlight the results, and then “script as insert”.

2022-05-03 10_57_38-SQLQuery2.sql - ARISTOTLE_SQL2017.sandbox (ARISTOTLE_Steve (66))_ - Microsoft SQ

The other option is to “build” an insert statement like this:

SELECT TOP 10
        '(''' + CAST(spt.ProductionDate AS VARCHAR(10)) + ''', ' +
       + CAST(spt.Actual AS VARCHAR(10)) + ', '
       + CAST(spt.Estimate AS VARCHAR(10)) + ')'
FROM dbo.SolarPowerTracker AS spt;

I can wrap the INSERT tablename VALUES in front of this and then paste this into the post.

SQL New Blogger

Not really a technical post, but this does show a little technical skill. Writing about how you solve problems or build on other posts is a good way to show you have some varied skills that an employer might like.

This post took me about 15 minutes to write.

Posted in Blog | Tagged , , | Comments Off on Posting Data and Code–#SQLNewBlogger

Daily Coping 11 May 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 look for people doing good and reasons to be cheerful.

Early on in the pandemic I was entertained by Some Good News. John Krasinski. At a time when I was worried, scared, and a little depressed at the world, the short episodes reminded me of how wonderful the world is.

Lately, I’m a bit optimistic about space. SpaceX continues to launch rockets at a furious pace, showing the world that this doesn’t need to be as complex, costly, and time consuming as it has been in the past. My son works at ULA and is helping to test their next generation of cheaper rockets that can be used to create new opportunities. Another friend just started at Sierra Space, a new company that is aiming to build a space plane and commercial space stations.

While there is plenty to be concerned and worried about in life, I find these companies to be inspiring. As someone excited by science fiction, that loved the late Apollo and Space Shuttle missions in the 80s, and someone that thinks space and colonization of other planets can help us on this one, these are good things. These give me hope and excitement.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 11 May 2022

Daily Coping 10 May 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 send a friend a photo from a time you enjoyed together.

I ran across this one the other day. Some of you might know this guy.

Photo Apr 15, 8 28 42 PM

I haven’t seen him in years. I reached out and found him, then sent this along. A fun time at a conference years ago.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 10 May 2022