The Voice of the DBA

Blog Post

A Double Day

I’m traveling back from Australia today. A few weeks ago I lost a day when I flew West across the Pacific. Today I get it back, with a different...

2019-06-16

34 reads

Blog Post

Simulating Load

I needed to generate some load for a demo and wasn’t looking forward to doing it. I was in a hurry, and didn’t want to deal with a lot...

2019-06-27 (first published: )

480 reads

Blog Post

A Lost Day

I’m writing this in advance, as I usually recommend for all bloggers, because this is a lost day for me. I’m not going to experience May 27th, 2019 on...

2019-05-27

41 reads

Blogs

T-SQL Tuesday #202 SQL Server Outage You’ll Never Forget: A Roundup

By

When I put together the invitation for T-SQL Tuesday #202, I wasn't sure what...

A Last Minute Trip to the EU

By

My life has some crazy travel stretches for sure. Between speaking, office visits, customer...

Part 3 of 3: Tuning DiskANN — R, Alpha, L, Beam Width, Recall and Latency

By

In Part 1, we saw how ‘Vamana’ represents vectors as nodes, connects them with...

Read the latest Blogs

Forums

Server-Level Table sizes

By Artur Sanin

Comments posted to this topic are about the item Server-Level Table sizes

ORDER BY alias

By aniap

Comments posted to this topic are about the item ORDER BY alias

Optional Parameter Plan Optimization in SQL Server 2025: Fixing the Kitchen-Sink Search Procedure

By vgupta

Comments posted to this topic are about the item Optional Parameter Plan Optimization in...

Visit the forum

Question of the Day

ORDER BY alias

There is a table tmp_tab:

CREATE TABLE tmp_tab (
id int,
val int
);
INSERT INTO tmp_tab VALUES
(1, 1),
(2, NULL),
(3, 3),
(4, 4),
(5, 5);
You want to order the rows ids by the following expression:
    ISNULL(val, id) + 1
Which of the following queries produces the expected ordering and why? (Select all correct)

See possible answers