PASSITON discount code for PASS Summit 2018
This week only PASS has a new discount code of PASSITON for an additional $200 off 3-day registration. This is...
2018-09-18
331 reads
This week only PASS has a new discount code of PASSITON for an additional $200 off 3-day registration. This is...
2018-09-18
331 reads
This month was my turn to host T-SQL Tuesday. I chose Trigger Headaches or Happiness as the topic, and I...
2018-09-18
895 reads
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the...
2018-09-18
385 reads
I am quite excited to announce that the latest, most up to date, and by far the largest, copy of...
2018-09-18
340 reads
In my recent post, Installing External Modules into SQL Server’s Python I had a look at just how simple it is to...
2018-09-18
602 reads
Here is a DMV script to check whether a or any database has the auditing configured and running, along with...
2018-09-18
780 reads
Do you ever wonder if there are any databases in your environment that may just be there but not being...
2018-09-18
187 reads
SELECT TOP 50
QueryState.execution_count
,OBJECT_NAME(objectid)
,query_text = SUBSTRING(
qt.text,
QueryState.statement_start_offset/2,
(CASE WHEN QueryState.statement_end_offset = -1
THEN len(convert(nvarchar(max), qt.text)) * 2
ELSE QueryState.statement_end_offset
END - QueryState.statement_start_offset)/2)
,qt.dbid
,dbname = db_name(qt.dbid)
,qt.objectid
FROM sys.dm_exec_query_stats QueryState
CROSS APPLY sys.dm_exec_sql_text(QueryState.sql_handle) as qt
ORDER BY...
2018-09-18
2,115 reads
A while back I built an automated process that parses JSON strings into a relational format.
Up until recently this process...
2018-09-18
1,671 reads
Watch this week's video on YouTube
A while back I built an automated process that parses JSON strings into a relational format.
Up until recently this process had been working great:...
2018-09-18
13 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