Displaying Currently Set Switches with sysoptions

The number column of sysoptions contains the switch ID for currently set switches.

sysoptions shows these switches:

sysoptions shows only the switches that are visible to the user. Users cannot see switches set privately by other spids. The value for number is Null for all option categories other than switches.

sysoptions displays this information for switches:
This query displays all sysoptions entries for switches:
select * from sysoptions
where category = 'Switch'
This query displays the switches set for the current session:
select * from sysoptions
where category = 'Switch'
and currentsetting = '1'
This shows the sysoptions output after setting trace flag 3604:
spid       name                              category          currentsetting      defaultsetting         scope               number
------     ----------------------------     ---------------  ---------------
      ----------------       ------------         --------------
    11           print_output_to_client              Switch                1
                     0                  8                                3604