Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 ansi_nulls and quoted_identifier

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2009-08-03 : 16:53:05
Hello,

I was checking an example for creating tables and before each table creation I have the following:

set ansi_nulls on
go
set quoted_identifier on
go
create table dbo.Roles ( .... )

I don't use this when creating my tables.

Do I need it? If yes, why?

johnconstraint
Starting Member

23 Posts

Posted - 2009-08-04 : 12:25:27
It depends on the SQL server database setup. If the database is setup with ANSI_NULLS ON and QUOTED_IDENTIFIER ON, I think you need not use them when creating tables.

The ANSI standard states that if you are comparing two columns of data that have NULL value in them, then the comparison should fail and should not return the rows with NULL values, when you use the equals sign (=) and not equals (<>) operators. Setting ANSI NULL values to OFF alters the standard.

Details on QUOTED_IDENTIFIER
http://msdn.microsoft.com/en-us/library/ms174393.aspx
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-08-04 : 13:24:04
For more on Quoted_identifier see this (old) post:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=99556



Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -