Hi @DJ Olsen ，

Welcome to Microsoft Q&A!

Actually SQL Server converts the **CHOOSE** to a bunch of **CASEs**.

The definition of **choose(x, a, b)** is equivalent to:

```
case when x = 1 then a
when x = 2 then b
end
```

Simply enough when x is a constant or when x refers to a column or when x is a non-volatile expression. But 99.9% counter-intuitive when x is a **non-deterministic** expression.

Your first query is executing like below:

```
SELECT case when abs(checksum(NEWID()))%2+1 = 1 then 'A'
when abs(checksum(NEWID()))%2+1 = 2 then 'B' end
FROM (VALUES (1),(2),(3),(4),(5))FiveRows(RowNum);
```

Then above expression has two random numbers. In fact, one random number for each possible target.

Only about 25% percent of the time, both comparisons will fail. And, the result will be NULL.

Best regards,

Melissa

If the answer is helpful, please click "**Accept Answer**" and **upvote** it.

**Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.**