Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

476


Part V: Enterprise Data Management


The connection-level options are typically confi gured by means of the SET command. The
following code confi gures how SQL Server handles nulls within this current session:

SET ANSI_NULLS OFF;

Result:

Command(s) completed successfully.

Connection properties can also be checked by means of the SessionProperty() function:

Select SESSIONPROPERTY ('ANSI_NULLS');

Result:

0

Management Studio enables you to set several query properties. You can review and set
these properties for current queries by clicking the Query menu and then Query Options.
For all future connections, review and set the properties by clicking the Tools menu and
then Options. Figure 19-3 shows an example of the ANSI settings that SQL Server uses to
run the queries.

FIGURE 19-3
The ANSI settings that SQL Server uses to run your queries.

To view current settings of connection-level options, query the sys.dm_exec_connections dynamic manage-
ment view.

c19.indd 476c19.indd 476 7/30/2012 5:42:48 PM7/30/2012 5:42:48 PM


http://www.it-ebooks.info
Free download pdf