Dropping Foreign Keys The Lazy Way
Hello!
So, on another blog a long time ago, I wrote a couple of posts about foreign keys and what step...
2017-04-18
134 reads
Hello!
So, on another blog a long time ago, I wrote a couple of posts about foreign keys and what step...
2017-04-18
134 reads
This is hardly breaking news, but it’s important to know: when using NOLOCK table hints in SQL Server, it can...
2017-03-17
3,132 reads
The data compression feature in SQL Server can help reduce the size of the database as well as improve the performance of intensive I/O intensive workloads, especially on data...
2016-10-28
15 reads
Earlier this year, I wrote a long post about log shipping. One of the key points I mentioned was how slow restoring can be for a read only log...
2016-08-30
13 reads
I recently had a comment posted to one of my first articles I wrote way back in 2012 concerning adding a column that detailed the used space as a...
2016-02-06
22 reads
2015-12-15
7 reads
Recently I needed to find a stored procedure that was creating a lock on a table and updating the table regularly. So my starting point was the table name,...
2015-04-30
10 reads
Today I am going to talk about the stored proc sp_executesql and the benefits it has over EXEC @SQL. Microsoft actually recommend that you use the sp_executesql stored procedure...
2014-10-27
14 reads
Another pithily titled blog post, but this one revisits the feature of SQL Server 2014 that piqued my interest the most: Clustered Columnstore Indexes. I’ve been working with Clustered...
2014-08-18
381 reads
I’ve been going through the process of upgrading from SQL Server 2012 to SQL Server 2014 and I’ve hit a bug when running snapshots. Any snapshot that was in...
2014-06-18
17 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 Risk Vs Reward, The never...
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...
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