Daily Coping 20 Aug 2020

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.

Today’s tip is to be thankful for your food and the people who made it possible.

At home, it’s usually me that cooks. I enjoy it, and I appreciate it when someone else does cook. It was a real treat a month or so ago when my son came down, bought supplies, and made sushi for me while I got to sit at the counter and relax.

20200611_193929_HDR

As someone that’s worked in lots of restaurants, I appreciate the work people put into cooking and serving food. During the pandemic, I’ve rarely gotten prepared food, but I have gotten a few meals. In particular, one of my local groceries has fresh sushi they make. I make it a point to complement the chefs there and thank them for making it.

I also try to stop and think about how hard it must be for certain people to work in the restaurant business, owners, cooks, servers, etc., all struggling I’ve tipped more, and as I write this, my wife and daughter are heading to town to a local Poke bowl place. We used to get bowls and sushi there, but the owner had to shrink is menu to just ramen and poke. My wife tries to go once a week to support him and say hi.

Always remember your circumstances, no matter how hard or easy, are not what others experience. Keep empathy in mind.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 20 Aug 2020

A Quick SQL Change Automation Build

I was going through a few of the Redgate products with a customer recently and they wanted to perform some validation of the build and release process with SQL Change Automation without setting up Azure DevOps or Jenkins or any server. Not a  bad idea, and a good way to actually learn how to do things.

Working with PoSh is a little funny, since many of the Redgate cmdlets require objects, not strings, so this is a quick post on how to get a build working and output a nuget package with your database code.

Prerequisites

The things you need to do before we get started:

  • Have a SQL Server instance you are a sysadmin of (or at lease create/own dbs)
  • Install SQL Change Automation
  • Set up a SQL Change Automation Project
  • Create a folder for storing build artifacts

The Script

I’m going to show the script first, and then I’ll describe how a few things work, since I expect some people want to just get a build working.

# Build script for SCA projects
param( $OverrideVersion="3.2")
# Instance variables
#    BuildInstance - SQL Server instance name for building 
$BuildInstance = "Aristotle"

# Database Variables
#    BuildDB - existing database used for build connection. Won't be altered
$BuildDB = "builddb"

# Package Variables
#    PackageID - Set the nuget package name to be used
#    PackageVersion - suffix on nuget package id.
$PackageID = "SimpleTalkDB"
$PackageVersion = $OverrideVersion

# Path variables
#   ProjectFile - full local path to the SCA project file (.sqlproj)
#   BuildArtifactPath - Path where the Nuget package is stored
$ProjectFile = "E:\Documents\git\SimpleTalkDemo\SimpleTalkDB\SimpleTalkDB.sqlproj"
$BuildArtifactPath = "E:\buildartifacts"

# Debug
# Use Continue to get more output
$DebugPreference = "SilentlyContinue"

# Setup database connections using variables from above to the build instance
$BuildConnection = New-DatabaseConnection -ServerInstance $BuildInstance -Database $BuildDB

# Build the database with a validate
$ValidProject = Invoke-DatabaseBuild $ProjectFile -TemporaryDatabaseServer $BuildConnection 

# Get the artifact and write to disk. Note the name comes from the package vars above.
$buildArtifact = New-DatabaseBuildArtifact $ValidProject -packageId $PackageID -PackageVersion $Version

Export-DatabaseBuildArtifact $buildArtifact -Path $BuildArtifactPath

This is a basic script that validates a SQL Change Automation project and packages up a particular version of your project.

The way this works is as follows. First variables. For the build I need to change these:

  • BuildInstance – where will I run the build
  • BuildDB – I just need an existing database for the build. We actually won’t use this.
  • PackageID – Name for the nuget package
  • PackageVersion – What version. This can be passed into the script as a parameter
  • ProjectPath – Where is the sqlproj file from SQL Change Automation
  • BuildArtifactPath – Where am I storing the artifacts.

The flow of the script is:

  • Set variables
  • Create a connection to a SQL Server (New-DatabaseConnection)
  • Build, which is to perform a project validation on a SQL Server (Invoke-DatabaseBuild)
  • Create the artifact in memory (New-DatabaseBuildArtifact)
  • Write the nuget package to disk (Export-DatabaseBuildArtifact)

From here, I’d use the Nuget package as the start of a release process, another post for another day.

I can override the package version with a parameter, so I can enter this on the cmd line:

.\builddb.ps1 3.3

That gives me a build that works on my system.Successful build from PoSh

In my folder for BuildArtifacts, I see the new package.

List of nuget packages in folder

Give it a try, and let me know if this works for you.

Posted in Blog | Tagged , , | Comments Off on A Quick SQL Change Automation Build

Summer Reading

I love to read. Ever since I was a kid, I’ve almost always had books nearby. In fact, I used to go to the PASS Summit with 5-6 books in my suitcase, just in case I went on a reading spurt while I was there. I’ve actually finished 4 or 5 books during that trip.

Every year, I used to love to see Paul Randal’s summary of his reading (2019 here). While I don’t do the data analysis that Paul does, his past posts did inspire me to use GoodReads and track my own reading. Last year, I read 128 books, most of which were fiction. I lean that way, as a way to escape from the chaos of life. So far this year I’m up to 57, though most of that was my sabbatical and the early pandemic times. Now I’m busy and slowing down the reading.

We’re nearing the end of summer, a time when I’ve usually read less as I’m outdoors more. Perhaps that’s the same for many of you, but it will get cold at some point, and I assume most of you will find free time to enjoy a little reading.

Today I’m wondering if there are books you recommend for people to read in the technology area. What books have you enjoyed that are based around technology?

I ran across a post from Frank Denneman, asking about your favorite tech novel. I’ve read a few on his list, and added a couple others to my list. I also listened to Kendra’s podcast on software development, where she mentions the summer book club from IT Revolution where people are reading The Unicorn Project. I do recommend that one and The Phoenix Project.

Give us a recommendation today if you have one for a novel that you think of when I write “technological thriller.” Fiction or non-fiction.

I’ll leave two here that I enjoyed. Cryptonmicon from Neil Stephenson. It’s an interesting look at encryption and technology. The other one that comes to mind when I think of technology novels is Ready Player One. Maybe because I grew up in the 80s, but the whole idea of learning, living, and working in a computer reality, while still using computers to do things, was very enjoyable. If you saw the movie, read the book. It’s much better.

Steve Jones

Listen to the podcast at Libsyn, Stitcher or iTunes.

Posted in Editorial | Tagged | 2 Comments

Daily Coping 19 Aug 2020

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.

Today’s tip is to contact a friend to let them know you’re thinking of them.

When the pandemic hit, and we locked down travel and most interactions, I felt isolated. I started these tips back in March. I can’t believe I’m still doing these after 4 months. I also cam surprised how much they help me.

One of the ideas I had early on in March was to reach out to friends that I expected to see, but was suddenly separated from. I had it a point to reach out to 2-3 people every couple days and check on them. I picked up my phone, or Facebook, or email, and randomly hit a letter. I then picked a person and sent a “I’m fine, how are you doing” message. I was surprised how often this led to a 3-4 message exchange, taking up a few minutes of our day, before we both moved on.

I still do that, albeit a bit less, but I’m randomly checking on people, especially a few people that I know have had some difficulties and are struggling. I’d encourage you to do the same.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 19 Aug 2020