Returns information about the current SET options.
SET options can be modified as a whole by using the sp_configure user options configuration option. Each user has an @@OPTIONS function that represents the configuration. When first logging on, all users are assigned a default configuration set by the system administrator.
You can change the language and query-processing options by using the SET statement.
The following example sets
ON and then tests the value of
ON option prevents the message about the number of rows affected from being sent back to the requesting client for every statement in a session. The value of
@@OPTIONS is set to
512 (0x0200). This represents the NOCOUNT option. This example tests whether the NOCOUNT option is enabled on the client. For example, it can help track performance differences on a client.
SET NOCOUNT ON IF @@OPTIONS & 512 > 0 RAISERROR ('Current user has SET NOCOUNT turned on.', 1, 1)