SQL Server – Filtering objects in Object Explorer – Management Studio
When you are working on a database with a large number of objects sometimes it becomes a challenge to locate...
2013-05-28
1,031 reads
When you are working on a database with a large number of objects sometimes it becomes a challenge to locate...
2013-05-28
1,031 reads
In earlier version of SQL Server Management Studio (2005, 2008 and 2008 R2) you can show/hide results pane using keyboard...
2013-05-20
1,855 reads
Starting with SQL Server 2005 all tables are grouped into schemas. While creating a table if the schema name is...
2013-05-13
1,832 reads
By default SQL Server listens on TCP port number 1433, and for named instances TCP port is dynamically configured. There...
2013-05-07 (first published: 2013-05-01)
4,850 reads
To identify default data and log directories in SQL Server 2012 you can use SERVERPROPERTY() function. In SQL Server 2012...
2013-05-06
926 reads
There are two different command you can use to check if you are running 32-bit or 64-bit version of SQL...
2013-04-22
1,124 reads
Both Clustered and Nonclustered Indexes have same physical structure in SQL Server. Both are stored as a B-Tree structure in...
2013-04-19
1,946 reads
You can export data from SQL Server using BCP command for SQLCMD utility. However, these utilities does not support dynamic...
2013-04-17 (first published: 2013-04-09)
3,608 reads
To import data from an Excel file to SQL Server you can use SQL Server Import and Export Wizard. You...
2013-04-15
29,020 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,374 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