DBA Myths: You can’t use an alias in a DELETE statement
Recently I wrote about the myth that you can’t use an alias in an UPDATE statement. You can of course,...
2013-09-24
890 reads
Recently I wrote about the myth that you can’t use an alias in an UPDATE statement. You can of course,...
2013-09-24
890 reads
Last month I posted my stored procedures sp_SrvPermissions and sp_DBPermissions. I’m posting V2.0 of each with a few fixes. The...
2013-09-23 (first published: 2013-09-18)
2,467 reads
Last month I posted my stored procedures sp_SrvPermissions and sp_DBPermissions. I’m posting V2.0 of each with a few fixes. The...
2013-09-23 (first published: 2013-09-18)
2,095 reads
This is possibly the best blog I have every read on the subject of reviewing a database. It is witty,...
2013-09-17
712 reads
I’ve found a very common belief among users of T-SQL (both DBAs and Developers) is that you can’t use an...
2013-09-16
893 reads
Since Microsoft decided to drop the MCM/MCA program there has been an enormous amount of discussion about the program and...
2013-09-11
555 reads
I recently asked what the difference is between granting SELECT to a user (at a database level) and adding the...
2013-09-09
1,043 reads
I recently had the task of collecting job activity for the purposes of turning it into a report for some...
2013-09-05
16,108 reads
When I run “Script (say table) as” it isn’t (or is) (say generating scripts for indexes). How do I fix...
2013-09-03
780 reads
I like practice tests. Once I feel like I’m getting ready to take a certification exam I start taking an...
2013-08-28
1,034 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...
Telp/Wa 628218200203 Gedung Sutrado, Jl. Kenari 2 No.5 Lt. 1, RT.2/RW.3, Kenari, Kec. Senen,...
Telp/Wa 628218200203 Jl. Biak No.44 AB, RT.8/RW.11, Cideng, Kecamatan Gambir, Kota Jakarta Pusat, Daerah...
Telp/Wa 628217555651 Gedung Plaza Bank Index Ground, Jl. M.H. Thamrin No.57 Floor Suite GF-21,...
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