Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1407

Re: How to determine true contents of not null columns that display as empty

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: How to determine true contents of not null columns that display as empty
Date 2013-03-07 22:55 +0100
Organization Erland Sommarskog
Message-ID <XnsA17CE946F5CBFYazorman@127.0.0.1> (permalink)
References <60db4087-d8ae-4cbf-9a40-531637ccef0e@googlegroups.com>

Show all headers | View raw


Mark D Powell (Mark.Powell2@hp.com) writes:
> How can a "not null" colummn be empty?  Can anyone explain what I am
> seeing and where specifically in the documentation I can read up on
> this? 

NULL and the empty string are not the same thing.

NULL is an unknown value, for which three-valued logic applies. All
comparisons with NULL yield UNKNOWN, even NULL = NULL. Since the values
are unknown, we can't tell whether the two values are same or not.

An empty string on the other hand is a known value: a string with zero 
characters.


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to determine true contents of not null columns that display as empty Mark D Powell <Mark.Powell2@hp.com> - 2013-03-07 09:16 -0800
  Re: How to determine true contents of not null columns that display as empty rja.carnegie@gmail.com - 2013-03-07 09:29 -0800
  Re: How to determine true contents of not null columns that display as empty Erland Sommarskog <esquel@sommarskog.se> - 2013-03-07 22:55 +0100
    Re: How to determine true contents of not null columns that display as empty rja.carnegie@gmail.com - 2013-03-07 15:06 -0800
  Re: How to determine true contents of not null columns that display as empty Mark D Powell <Mark.Powell2@hp.com> - 2013-03-14 10:56 -0700

csiph-web