The Bit Bucket

Opinion: Why is leaving so hard?

One thing that has annoyed me for a long time is why applications and systems make it so hard to disconnect yourself from a tenant that you don’t control. Here are two examples:

Stripe Connect

The first one that’s frustrated me lately is Stripe. Setting up your own account is straightforward, and leaving isn’t too hard.

But they have a service called Stripe Connect. In this case, the account is basically set up for you by a vendor you are dealing with, essentially on your behalf.

2025-05-15

Book Review: Building Web APIs with ASP.NET Core

Over the years, one area that I have a great interest in, and yet I think gets nowhere near the right amount of attention is API design. So I was really interested to hear fellow MVP Valerio De Sanctis’ ideas in the new book Building Web APIs With ASP.NET Core .

API Design and Standards

I can’t tell you how many times I’ve had to work with poorly designed APIs. It affects me when working with data, but also affects almost every aspect of computing.

2025-05-14

SSMS Tips and Tricks 1-4: Add columns to Object Explorer Details

I’ve mentioned in an earlier article about scripting multiple objects at once, how useful the Object Explorer Details window is, and how little understood it is.

Another useful option in it, is that the displayed columns can be changed. In particular, you can add columns that would be useful. Let’s look at an example.

In Object Explorer, I’ve expanded the WideWorldImporters database and clicked on the word Tables:

Next, I hit the F7 key, and the Object Explorer Details pane opens showing this:

2025-05-13

SQL Interview: 47 Extracting hour from a datetime value

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Developer Level: Intro

Question:

You need to extract the hour component from a datetime value.

Which function should you use?

Answer:

To do this in SQL Server, you should use the DATEPART function.

2025-05-12

SSMS Tips and Tricks 1-3: Script multiple objects at once

If you want to script all the indexes on a table (or all the tables, all the stored procedures, etc, etc.), you can do that the long way by using the Generate Scripts right-click option for a database, but there’s a better way.

Let’s use the Purchasing.PurchaseOrderLines table from WideWorldImporters as an example. Here are the indexes on it:

image

The scripting options are well-known. You right-click the object, and can navigate to the scripting option:

2025-05-11

SQL Interview: 46 Self-join requirements

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Developer Level: Intro

Question:

You have a table named HumanResources.Employees. Some employees are managers.

You want to join the table to itself to join employee rows with their manager rows.

What is required when you join a table to itself, that is not required for joining separate tables?

2025-05-10

SSMS Tips and Tricks 1-2: Controlling quoting when dragging columns

Previously I showed how useful it is to be able to drag columns from either a table or from user-defined table type onto a query window.

But one of the first comments I hear from people who did that is:

I hate all those square brackets. How do I stop that?

The option to do that was added to Tools> Options > SQL Server Object Explorer > Commands:

Bonus points for the team because they also provided us with an option to decide whether schema names are dragged as well. That’s mostly used for tables but also applies to other schema-bound objects like stored procedures.

2025-05-09

SQL Interview: 45 Storing UTF-8 Data

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Developer Level: Intro

Question:

You are writing a function that needs to process UTF-8 data. It takes one input parameter named @ValueToProcess that varies in length.

Which data type should you use for the @ValueToProcess parameter?

Answer:

2025-05-08

SSMS Tips and Tricks 1-1: Dragging all column names from Object Explorer

This is a popular shortcut in SQL Server Management Studio (SSMS) but I continue to be amazed how many people aren’t aware of it.

Object Explorer is a very useful part of SSMS and you can drag pretty much any name that you see in it across to a query window.

You could do the same for each column in the Columns list.

You might also realize that you can hover over the asterisk and see a list of columns:

2025-05-07

SQL Interview: 44 Test for an integer value

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.

Section: Developer Level: Medium

Question:

You have a value in a variable named @NewValue. The data type is varchar(20).

You want to check if the value in the string is an integer and could be cast to an integer.

2025-05-06