The Bit Bucket

SQL Interview: 60 Rowversion vs Timestamp

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

Question:

You are reviewing T-SQL code from an application.

You notice in the definition of some tables, the timestamp data type has been used. In other tables, the rowversion data type has been used for similar purposes.

2025-07-03

SSMS Tips and Tricks 3-3: Apply cut or copy commands to blank lines when there is no selection

When I’m doing a lot of query editing, I often get a bit mesmerized, particularly if there’s a lot of manual copy and paste or cut and paste going on.

One thing that often drives me crazy is when I use Ctrl-C (ie: copy) when I meant to use Ctrl-V (ie: paste). Invariably, I do this when I have nothing highlighted at all. So not only did I not get the value pasted, I just copied an empty value into the clipboard.

2025-07-02

Book Review: Learn Microsoft Power BI - Third Edition

My friends at PackT recently sent me a review copy of fellow MVP Greg Deckler’s third edition of Learn Microsoft Power BI . It’s not released yet but is available for pre-order.

Production quality and additional resources

The book is written well and the copy and tech editing seem well handled.

I was particularly impressed to see that Art Tennick was a tech reviewer. I regularly mention Art’s books. I like the way he presents recipe style books. He did it with MDX and again with DAX. Many people don’t want a detailed coverage of a language, just a series of recipes on how to use it. That’s what some of Art’s books provide.

2025-07-01

SSMS Tips and Tricks 3-2: Useful keyboard shortcuts

Visual Studio is a very configurable tool, and particularly in the area of keyboard shortcuts. Because SQL Server Management Studio (SSMS) is based on Visual Studio, it inherits many of these configuration options. SSMS has a very rich set of keyboard shortcuts. Without trying to cover most of them, I do want to highlight a few that I think are really important to know how to use.

Let’s start with an easy set of commands.

2025-06-30

SQL Interview: 59 Schema Binding

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: Advanced

Question:

You are reviewing T-SQL code from an application.

You notice that a view includes WITH SCHEMA_BINDING in its declaration.

What does that affect?

Answer:

Adding WITH SCHEMA_BINDING to a view definition ensures that the underlying objects (like tables) cannot be changed while the view exists.

2025-06-29

SSMS Tips and Tricks 3-1: Using line numbers and Go To

If you ever have long scripts in SQL Server Management Studio and need to refer to a particular line, it can be helpful to have line numbers shown. This is even more useful if you ever need to write a set of instructions for someone on how to modify a query, or if you are trying to describe how a query works.

Instead of having a query like this:

2025-06-28

Book Review: Great Expectations: Part 1 (Mandarin Companion)

I recently read another Mandarin Companion book called Great Expectations Part 1 adapted by John Pasden from the Charles Dickens original book.

I love these books.

John Pasden is well-known to anyone who’s been learning Mandarin for any length of time. He was one of the presenters at ChinesePod over the years. He set up a company called Mandarin Companion that produces graded readers.

If you haven’t seen graded readers (in any language), they are reading books that limit the scope of the target language to a particular set of words (or in this case characters).

2025-06-27

SSMS Tips and Tricks 2-13: Using environment color themes

One feature that many developers have been asking the SSMS team for, is the ability to use a dark mode.

Instead of a screen that looks like this:

They wanted a screen that looks like this:

This capability is now present in SSMS. In Tools then Options then Environment then General, you can now choose a Color Theme:

Note that there are several themes now available, including a new extra contrast option.

2025-06-26

SQL Interview: 58 Trigger Firing Order

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: Administration Level: Advanced

Question:

If a SQL Server table has six triggers associated with it, what control do you have over the order that the triggers fire in?

Answer:

SQL Server doesn’t provide an option to control trigger firing order. However, it does provide an option to choose the first trigger to fire, and the last trigger to fire.

2025-06-25

SSMS Tips and Tricks 2-12: Using zoom features

When working with SQL Server Management Studio, sometimes you need to show someone else what you’re working on, and the fonts that you’re using are just too small for someone looking over your shoulder or looking at a screen that you’ve shared with them.

What I often see someone do then, is to go into Tools and Options and start to change the font and color settings. The pain with this is that you then need to set them back later.

2025-06-24