Shrinking a large database with limited outage windows
Yes, I realize you shouldn’t shrink your database (data files or log files), but I recently had a case where ... Continue reading
2019-05-06 (first published: 2019-04-22)
1,620 reads
Yes, I realize you shouldn’t shrink your database (data files or log files), but I recently had a case where ... Continue reading
2019-05-06 (first published: 2019-04-22)
1,620 reads
Tables, stored procedures, views, logins, constraints, etc, etc. It’s all just data. In every database system I’ve ever worked on ... Continue reading
2019-04-29 (first published: 2019-04-17)
500 reads
In my last post I discussed the fact that SQL Ids can, in fact, be useful on an instance that ... Continue reading
2019-04-15
3,567 reads
tl;dr; Yes, but. It’s generally considered more secure to have your SQL Server instance set to Windows Authentication and not ... Continue reading
2019-04-24 (first published: 2019-04-11)
463 reads
Todd Kleinhans (b/t) is host for T-SQL Tuesday this month and wants us to talk about how we use databases ... Continue reading
2019-04-19 (first published: 2019-04-09)
506 reads
Over the last almost 2 years (wow how time flys when you are having fun) we’ve practiced all kinds of ... Continue reading
2019-04-17 (first published: 2019-04-03)
360 reads
It is with a very heavy heart that I announce I will no longer be working with SQL Server. In ... Continue reading
2019-04-01
109 reads
Brent recently did a post called In Azure SQL DB, what does “The connection is broken and recovery is not ... Continue reading
2019-03-27
157 reads
Recently (honestly it’s been a few years now) Microsoft split the lifecycle for SSMS out from the general SQL Server ... Continue reading
2019-03-25
36 reads
As of SQL 2019 CTP2.0 or SQL 2017 CU12 Microsoft has given us a long-awaited addition to the truncation error....
2019-04-05 (first published: 2019-03-20)
2,046 reads
By Steve Jones
This is timely, as I’m currently on a boat in the Adriatic taking a...
You can find the slides and SQL scripts for my session “Spice up your...
By SQLPals
How to Clear the SSMS Cache (SSMS 21 and Later) Updated...
Comments posted to this topic are about the item Using CHOOSE()
Comments posted to this topic are about the item Re-Seeding a Broken Log Shipping...
Comments posted to this topic are about the item The DBA is Dead! Long...
We have this code that sets some status values and then queries them using the CHOOSE() function in SQL Server 2025.
CREATE TABLE Status
(
StatusID INT,
StatusDescription VARCHAR(20)
);
GO
INSERT dbo.Status
(
StatusID,
StatusDescription
)
VALUES
(0, 'Uncategorized'),
(1, 'Active'),
(2, 'Inactive'),
(3, 'Temp');
GO
SELECT CHOOSE(StatusID, 'Unknown', 'Active', 'Inactive', 'Temporary')
FROM Status;
When the SELECT runs, what is returned? See possible answers