ANSI_NULL and QUOTED_IDENTIFIER: ANSI_NULL: When ever we are creat ing or altering th e SQL objects like the Stored Procedure s and the User Defined Functions at t h at time most of us use this. Let us understand this better with an example let us create a table and insert some records, CREATE TABLE #Demo ( FName VARCHAR ( 200 ), LName Varchar ( 200 ) ) Insert #Demo values ( 'Ravi' , 'Shekhar' ) Insert #Demo values ( 'Isha' ,NULL ) Insert #Demo values ( 'Santosh' , 'Thakur' ) SQL Server tend s to behave differently when ever we use either the SET ANSI_NULL ON or the OFF . SET ANSI_NULL ON; If the ANSI_NULL is on then the comparison with NULL value with = or <> returns false. SET ANSI_NULLS ON SELECT * FROM #Demo WHERE LName = NULL SELECT * FROM #De...
Comments
Post a Comment