You don’t need to be a sysadmin
Hey, I need sysadmin access to ServerA.
Ok. Why do you need sysadmin?
Well I need to be able to read and...
2016-03-16 (first published: 2016-03-10)
2,324 reads
Hey, I need sysadmin access to ServerA.
Ok. Why do you need sysadmin?
Well I need to be able to read and...
2016-03-16 (first published: 2016-03-10)
2,324 reads
It’s T-SQL Tuesday time again (Number 76!) and this month we are hosted by Bob Pusateri (b/t) who has invited...
2016-03-08
1,167 reads
The question of How to grant the ability to create/alter stored procedures and views came up today on dba.stackexchange.com. It’s...
2016-03-11 (first published: 2016-03-02)
2,328 reads
What with the #sqlnewblogger effort we’ve been seeing a lot of new bloggers (and some old ones starting up again)...
2016-03-04 (first published: 2016-02-29)
1,255 reads
As with most of these types of things, I had a need. I want to show how using sys.dm_exec_[requests/sessions/connections] is...
2016-02-24
1,074 reads
I had one of my developers ask me why he keeps seeing the following warning when he tries to modify...
2016-02-22
1,154 reads
When developing in SQL Server you are eventually going to have to modify a column or two (at least). And...
2016-02-23 (first published: 2016-02-17)
3,974 reads
The other day I made a somewhat flip coment on twitter. (I know, everyone is shocked right?)
varchar(1) Really? It’s...
2016-02-15
1,637 reads
Clearing out a full transaction log is a common problem. A quick search will find you dozens of forum entries...
2016-02-10
578 reads
I use impersonation all the time to let me see additional permissions information I can only get that way and,...
2016-02-08
475 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