The Bit Bucket

Opinion: Consulting vs Mentoring

I was interested to see our old buddy Pinal Dave recently post a link to one of another old buddy Brent Ozar’s posts from 2015:

What’s the difference between a contractor, and consultant, and FTE?

Brent defined consultants as giving advice on what the client should do; whereas contractors turn up and do what they’re told. This distinction is pretty clear and I agree with him.

I always thought that was a great post but I also always thought it misses one additional category: mentor.

2018-03-06

Opinion: Don't reinvent the (database) wheel

There is an old saying about not reinventing the wheel yet this is something that I see happening at client sites every day. I see two main reasons why this happens:

Discoverability

[caption id=“attachment_2809” align=“alignnone” width=“339”] Image by Nathan Dumlao[/caption]

There are so many tools and frameworks in this industry, that you can’t be expected to know them all. I remember when I worked a lot with the .NET framework. I’d go into client sites and see them designing and building classes that were already in the framework. Worse, the framework classes were usually very well designed and tested.

2018-03-06

SQL: SELECT 1 for testing connectivity is pointless

I spend quite a bit of time tracing queries sent from applications to SQL Server.

Having now done this for a long time, I can recognize many of the data frameworks that are used by various developers. I think that if any of the developers ever spent much time looking at traces, they’d be amazed at how the requests they have made to the framework are translated to commands that are sent to SQL Server.

2018-03-05

DevOps: Should migration-based deployments use idempotent scripts?

In my last DevOps-related post, I discussed some of the issues that arise when using migration-based deployments.

Migration-based deployments are based on a series of T-SQL scripts that apply changes to your database from its current state to a desired final state.

One of the questions that arises though, is whether or not these T-SQL scripts should be idempotent ie:

Should the script be written so that you get the same outcome if you run the scripts multiple times?

2018-03-02

Shortcut: Import and Export Settings in SQL Server Management Studio

Whenever I need to work on a new laptop or server, or whenever I change versions of SQL Server Management Studio, I kick myself for not remembering to export my settings, so I can import them again.

I spend quite a bit of effort getting SSMS configured the way I want, so it only makes sense to save the settings. Saving them isn’t perfect but it’s far better than not having done it.

2018-03-01

SDU Tools for March 2018 - going out tonight

I’m really happy with the additions we made to our free SDU Tools for developers and DBAs that are going out tonight:

DatesBetween - table-valued function to return dates between two dates DateDimensionColumns - table-valued function to return typical date dimension columns for a date (useful for data warehouses)

JulianDayNumberToDate - converts a Julian day number to a date DateToJulianDayNumber - converts a date to a Julian day number

SystemConfigurationOptionDefaults - view that shows system configuration options and their default values (and many other values) NonDefaultSystemConfigurationOptions - view that shows system configuration options that are not at their default values

2018-02-28

SDU Tools: Separate T-SQL Strings By Case

If you’ve ever used SQL Server Reporting Services, you’ll notice that when you drag a database column into a table, it auto-magically converts the name of the column into a more English-readable name.

[caption id=“attachment_2791” align=“alignnone” width=“429”] Image from MSDN[/caption]

Notice how when the LineTotal column has been dragged into the table, the heading has been set to Line Total with a space. What it is doing is taking a Pascal-cased or camel-cased name and separating the words with spaces, based upon where the capital letters are.

2018-02-28

Opinion: To find good staff, invest in communications, not buildings

Many of my customers are software houses (ISVs). In almost all of them, I hear people complaining that they can’t find enough good staff. I think they are trying to tackle the wrong problem.

Most of the staff members they are trying to find are developers, and there are so many great developers out there, but you have to accept that they might not be in the location that you hope they’re in.

2018-02-27

SQL: Real triggers, SET NOCOUNT ON, and Counting Correctly

I’ve done a lot of Microsoft exams over the years, mostly SQL Server ones but plenty of others too. And one thing that I really don’t like is when the questions are:

  • Purely academic (ie: would never happen)
  • Memory based (ie: who cares what the DTU limit is for a P3 today?)
  • Clearly not written by someone who actually uses the product

Today, I want to mention an item in the last category.

2018-02-26

DevOps: Dealing with issues in migration-based deployment of databases

In an earlier post, I described the difference between state-based deployments and migration-based deployments. What I want to talk about today are two of the main issues that can arise in a migration-based deployment and what to do about one of them.

When you are using a migration-based deployment technique, you are storing all the scripts that take a database from its current state to the desired final state. While tools like Ready Roll make this is a relatively easy way to perform migrations, it suffers from a few key problems:

2018-02-23