Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi Friends....

I want to know the meaning of

VB
SET ANSI_NULLS ON     

AND

SET QUOTED_IDENTIFIER ON
Posted

You can check from the links

http://blog.sqlauthority.com/2007/03/05/sql-server-quoted_identifier-onoff-and-ansi_null-onoff-explanation/[^]

http://praveenbattula.blogspot.com/2009/05/use-of-set-ansinulls-on-in-sql-server.html

ANSI_NULLS ON

This option specifies the setting for ANSI NULL comparisons. When this is on, any query that compares a value with a null returns a 0. When off, any query that compares a value with a null returns a null value.

QUOTED IDENTIFIER ON/OFF:
This options specifies the setting for usage of double quotation. When this is on, double quotation mark is used as part of the SQL Server identifier (object name). This can be useful in situations in which identifiers are also SQL Server reserved words.
 
Share this answer
 
When
SQL
SET ANSI_NULLS ON

it means ISO Standard is being followed.
means
= and <> should not be used for null comparison.

If you want to use = or <> for null comparison use
SQL
SET ANSI_NULLS OFF

it means do not follow ISO Standard.

SQL
SET ANSI_NULLS
should be set to ON for executing distributed queries
for maintaining compatibility of queries accross Servers.

and

QUOTED_IDENTIFIER
It specifies how SQL Server treats the data that is defined in Single Quotes and Double Quotes. When it is set to ON any character set that is defined in the double quotes “” is treated as a T-SQL Identifier (Table Name, Proc Name, Column Name….etc) and the T-SQL rules for naming identifiers will not be applicable to it. And any character set that is defined in the Single Quotes ‘’ is treated as a literal.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900