Azure-Sql-Db

SSMS Tips and Tricks 3-4: The magical F1 key - help on syntax and metadata

Years ago, I used to always recommend that people install Books Online (BOL) on their systems. It’s ironic that it was called “Online”, given we’re really talking about “Offline”, but back when we first were talking about it, we were comparing it to a physical book, not to a live reference on a computer screen.

Nowadays though, I find that the version online is so far superior to the one that you can install locally, that I think it’s better to just use the online version. I particularly like the way that the online books are now cross-version ie: each page covers all supported versions, instead of having a separate page for each version.

2025-07-04

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

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

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

SSMS Tips and Tricks 2-11: Use visual glyphs for word wrap

Code quality has always been an important topic ever since coding began. Code complexity is an important part of this. One of the topics that came up many years ago was a discussion on what length procedures or functions should be, before they became too difficult to follow.

I remember one guy commenting that he thought as soon as all the code didn’t fit on your screen any more, you were much more likely to have bugs in it. At the time, screens weren’t all that big.

2025-06-22