Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

@@OPTIONS (Transact-SQL)

Returns information about the current SET options.

Topic link icon Transact-SQL Syntax Conventions


@@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 NOCOUNT ON and then tests the value of @@OPTIONS. The NOCOUNT 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)
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.