How do I grant permissions to view users and their permissions?
tl;dr; VIEW DEFINITION
Every now and again you’ll have a user that needs to be able to see what permissions other...
2018-09-17
352 reads
tl;dr; VIEW DEFINITION
Every now and again you’ll have a user that needs to be able to see what permissions other...
2018-09-17
352 reads
Recently I did a presentation on dynamic SQL. In the presentation I pointed out the similarity of using sp_executesql to...
2018-09-24 (first published: 2018-09-13)
3,937 reads
Anything that happens in a trigger happens within the same transaction of the command that called it.
Part of me feels...
2018-09-11
218 reads
tl;dr; While the difference is very important 90% of the time you won’t care and should just add the two...
2018-09-13 (first published: 2018-09-05)
3,666 reads
In the very first SQL Homework post you were asked to take a backup. In fact it asked you to...
2018-09-03
811 reads
A few years back someone started the Advent of code. If you aren’t familiar with it, it’s an advent calendar...
2018-08-29
526 reads
I was reading a post today by Bert Wagner (b/t).
Displaying Long Variable Values in SQL Server
By the way, if...
2018-08-27
923 reads
Last month Steve Jones (b/t) suggested that it might be helpful if those of us that work in the IT/database...
2018-09-06 (first published: 2018-08-22)
1,662 reads
Last Thursday I spoke at NTSSUG (North Texas SQL Server User Group). This is my local group (only 1.5 hours...
2018-08-20
220 reads
Permissions are a common concern. One of the most frequent requests I get is I need X, Y and Z...
2018-08-29 (first published: 2018-08-16)
3,205 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