Site icon Database Tutorials

CHOOSE Function On SQL Server

 

Did you know the CHOOSE function in SQL Server? This function introduced with SQL Server 2012.

The CHOOSE command can provide practical use for situations such as the example above.

For example:

Here is the CASE WHEN version of the command I wrote above with CHOOSE:

It doesn’t contribute to performance, but as I said, it makes it easy to write code.

Exit mobile version