In this post, I provide a small note on QUOTED_IDENTIFIER and ANSI_NULL of SQL Server.
This is very basic and most popular topic for all SQL Server Professionals.
You can find an N number of article and discussion on this topic. But I always like to write this kind of popular topic in my words.
SET QUOTED_IDENTIFIER ON
SET QUOTED_IDENTIFIER OFF
This option is ON and characters enclosed within double quotes than is treated as an Identifier.
This option is OFF and characters enclosed within double quotes than is treated as a Literal.
Using this option you can use SQL Server reserved words as an Identifires.
SET QUOTED_IDENTIFIER ON GO
CREATE TABLE dbo.”Table”
(id int,”View” VARCHAR(255)) GO
SET ANSI_NULLS ON
SET ANSI_NULLS OFF
This option basically for ANSI NULL comparisons. If this option ON and you compare your query value with a NULL, then result is 0.
If this option OFF and you compare your query value with a NULL, then result is NULL.
In a future version of SQL Server, ANSI_NULLS will always be ON and any applications that explicitly set the option to OFF will generate an error.
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.