Time Trial sys.dm_exec_query_plan vs sys.dm_exec_sql_text
I’ve been working on a way to test performance usage on a server by database. I started out using sys.dm_exec_query_stats...
2012-11-12
1,716 reads
I’ve been working on a way to test performance usage on a server by database. I started out using sys.dm_exec_query_stats...
2012-11-12
1,716 reads
About three years ago my manager came up to me and said “We need someone to learn SSIS, you’re it.” ...
2012-11-07
1,189 reads
This is just a quickie post to answer a question on how to loop through multiple servers in SSIS. There...
2012-11-05 (first published: 2012-10-31)
5,094 reads
Many years ago when I was still working on SQL 2000 I occasionally needed to find all stored procedures and views...
2012-10-26
15,001 reads
Every now and again (today for example) I’ll get a call that one of our SQL Server instances is down. ...
2012-10-23
1,272 reads
2012-10-22
2,314 reads
I recently started using OBJECT_NAME, OBJECT_SCHEMA_NAME and OBJECT_ID functions; unfortunately I really could have used OBJECT_TYPE but it doesn’t exist...
2012-10-19
1,259 reads
I recently passed my MCTS 2008 Development (70-433). Yay me! That made my 3rd 2008 certification. This one was probably the...
2012-10-15
1,859 reads
Multiple CTEs
It’s somewhat obscure in BOL and I wasn’t able to find any examples but it turns out you can...
2012-10-11 (first published: 2012-10-09)
4,590 reads
I’ve been unable to connect to a server via one of its aliases for about a week. When I looked...
2012-10-05
2,021 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