The Bit Bucket

SSMS Tips and Tricks 3-11: Using bookmarks

In a previous post, I was discussing how outlining can be helpful with navigating around within a large T-SQL script file.

If you were trying to do that within a Microsoft Word document, the most common thing to use is bookmarks, and SQL Server Management Studio (SSMS) has them as well.

Bookmarks are simply placeholders within a script. (They can also apply to other types of document within SSMS). Where I find them very useful is when I’m working in two or three places within a long script at the same time. Perhaps I’m working on a function, and also on the code that calls the function. By using bookmarks, I’m not flipping endlessly around the script file, and can jump directly from placeholder to placeholder.

2025-07-18

General: Auto-populating future posts in Hugo-based Azure Static Websites

I posted a while back about moving to using Hugo-based Azure Static Websites for my blog and other simple sites. I love having source code based websites.

However, one thing I wasn’t expecting was about how future blog posts would be handled. I tend to generate posts well in advance, and I wanted them to appear all by themselves when the appropriate date came.

I thought that even a static website would just show you things within the date range. But that’s not how it works. When you build a Hugo based site, it generates a site that includes all the posts that should be shown up to the time you build it.

2025-07-17

SSMS Tips and Tricks 3-10: Using code outlining

For some years now, SQL Server Management Studio (SSMS) has had the ability to use code outlining, the same way that other Visual Studio languages can.

This can be very useful when you are trying to navigate around a large script file.

The simplest usage is to collapse or expand a region of code. Note that in the following script, code regions have been automatically added by SSMS:

This allows us to click on the outline handles, and collapse the code:

2025-07-16

SQL Interview: 63 Keys contained in certificates

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: Security Level: Medium

Question:

Public key encryption is based on combinations of private keys and public keys.

When you install a certificate on a SQL Server, to be used for client connection encryption, which key or keys are contained in the certificate?

2025-07-15

SSMS Tips and Tricks 3-9: Using the clipboard ring

Two key combinations used by SQL Server T-SQL developers every day are Ctrl-C and Ctrl-V for copy and paste.

But many users of SQL Server Management Studio (SSMS) don’t realize that it has a clipboard ring and can deal with several objects in the clipboard at the same time.

Let’s see an example.

In this screen shot, I’ve opened a query window with the source code of the AnalyzeTableColumns procedure from SDU Tools.

2025-07-14

Book Review: Why we argue and how to stop

Sometimes I’m sent books to review and I just don’t get around to it fast enough. This book was one of those. Why we argue and how to stop: A Therapist’s Guide to Navigating Disagreements, Managing Emotions, and Creating Healthier Relationships by Jerry Manney .

I found this book quite interesting.

Early on, Jerry notes that journaling is important because memory is unreliable. Jerry said I learned a long time ago that one of the key characteristics of a knowledgeable and successful person is not how much they can remember, but whether they have a method or system for accessing important and relevant information when they need it. I’m certainly learning that more as I get older.

2025-07-13

SSMS Tips and Tricks 3-8: Selecting and modifying rectangular regions

I often see people doing very repetitive editing tasks that could easily be carried out by using selecting and changing rectangular regions of code.

The simplest example of doing this is to insert some text on a number of rows. Take the following code as an example:

I’ve got the skeleton of a list of columns in a CREATE TABLE statement but let’s assume that I’m a comma in front person and want to put a few spaces and a comma, etc. in front of each column after the second.

2025-07-12

SQL Interview: 62 Selecting rows for a date

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: Development Level: Intro

Question:

You have a table of transactions. You need to select all the transactions for a particular date, based on the TransactionDateTime column. It holds datetime data type value. The date is stored in the @RequiredDate variable.

2025-07-11

SSMS Tips and Tricks 3-7: Replace tabs with spaces and do macro-like work using regular expressions

A request that I hear all the time, is “I don’t like tabs but insert name of annoying colleague here decided he likes to use them. How do I remove them?” Similar thing happens when installing SSMS and leaving the default options.

Tabs vs Spaces

Whether to use tabs or spaces leads to near religious level arguments amongst SQL developers. I see strong arguments on both sides. In the past, I’ve always ended up using spaces because I’ve run into issues with tabs in some of the tooling that I needed to use.

2025-07-10

Opinion: Influencing others effectively

One of the things many people don’t know about me, is that I spent many years both playing and umpiring baseball. Clearly that’s not so common for Australians.

In many ways, the umpiring was probably the most interesting. I’ve umpired up to state level games, including the Pan Pacific games. It certainly teaches you how to deal with strong views effectively.

Most people have seen the classic images of managers/coaches racing out to have a very heated discussion with an umpire. I’ve had so many people asking me how I dealt with that when I was umpiring.

2025-07-09