Answer - Question of the Week - 28/12/2013 - Question 2
Question:- Suppose we have a table named tbl_charactername have only one column say "charactername".It contains 10 rows. First 5 rows contains...
2014-01-01
605 reads
Question:- Suppose we have a table named tbl_charactername have only one column say "charactername".It contains 10 rows. First 5 rows contains...
2014-01-01
605 reads
In While loop, we set a condition for the repeated execution of a SQL Code block or a SQL Statement....
2014-01-01
22,851 reads
HAPPY NEWYEAR2014
Wishing all of the readers of this blog a very happy New Year. Thanks for supporting me and my...
2013-12-31
1,031 reads
Many times we caught in a situation where we have a table where there is no primary or unique column...
2013-12-29
59,420 reads
Question:- Suppose we have a table says tbl_students whose structure is given below:-
Create table tbl_students(Studentid int identity(1,1) , Studentname nvarchar(150))
Suppose it...
2013-12-28
779 reads
Question:- Suppose we have a table named tbl_charactername have only one column say "charactername".It contains 10 rows. First 5 rows...
2013-12-28
540 reads
Suppose we have a table says tbl_students whose structure is given below:-
Create table tbl_students(Studentid int identity(1,1) , Studentname nvarchar(150))
Suppose it contains...
2013-12-25
479 reads
Ranking Function:- Sometimes we need to provide a Row number to the rows in a table or within a partition....
2013-12-25
9,968 reads
Stuff function: - This function is used to replace string from the given start position, passed as 2nd argument with string...
2013-11-25
34,565 reads
Case Statement/ Expression in SQL server
Sometimes we need to get one result output from multiple possible outcomes based on the...
2013-11-25
1,797 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