SQL Saturday#197–Omaha Recap
This was the second SQL Saturday hosted in Omaha. I loved to see how the event grew from the first...
2013-04-12
483 reads
This was the second SQL Saturday hosted in Omaha. I loved to see how the event grew from the first...
2013-04-12
483 reads
Hello Dear Reader! I was teaching a class in Chicago last week and I got a lot of really great...
2013-04-12
1,139 reads
Last time I posted about How you can add date/time to output file name, in which I used xp_cmdshell to...
2013-04-12
2,373 reads
Apologies if you went to my site this morning to see my blog from the bloggers table at PASS Business Analytics...
2013-04-12
742 reads
SQL Example:
DECLARE @TableRowsCount table
(
Tablename varchar(50),
cnt int)
insert into @TableRowsCount
EXEC sp_MSforeachtable @command1=” select ‘?’,count(*) from ?”
select * from @TableRowsCount
PowerShell Example:
Load SQL PowerShell by...
2013-04-11
1,150 reads
A tweet from Ted Krueger (Blog | @Onpnt) this morning…
I’m surrounded by BI people!!!!#passbac
— Ted Krueger (@onpnt) April 11, 2013
inspired a little creativity…
You...
2013-04-11
776 reads
Like many of us, I have a collection of favorite movies. These include Ghostbusters, Stripes, Serenity, and dozens more. I...
2013-04-11
777 reads
We all know that we should document our SQL Servers, right? RIGHT?
So let's say you had some time on...
2013-04-24 (first published: 2013-04-11)
3,816 reads
Change Database name of a below mentioned query
DECLARE @cntr_value1 bigint
DECLARE @cntr_value2 bigint
SELECT ‘BEFORE’
SELECT @cntr_value1 = cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = ‘transactions/sec’
AND object_name = ‘SQLServer:Databases’
AND...
2013-04-11
627 reads
Replace a valid server name in the following examples. Try to do a testing on your local machine and understand...
2013-04-11
3,376 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