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


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

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

Newsgroups comp.databases.ms-sqlserver
Date 2013-03-07 15:06 -0800
References <60db4087-d8ae-4cbf-9a40-531637ccef0e@googlegroups.com> <XnsA17CE946F5CBFYazorman@127.0.0.1>
Message-ID <934dac0f-4cde-46d7-97af-87a7117a9948@googlegroups.com> (permalink)
Subject Re: How to determine true contents of not null columns that display as empty
From rja.carnegie@gmail.com

Show all headers | View raw


I think I remember from one of Kalen Delaney's 
"SQL Server Internals" manuals - probably the
2000 edition - that nulls in columns are stored
in one or more extra bytes in a table row's 
storage, each binary digit representing 
whether the first / second / third column etc.
is NULL in the row.  That means that the NULL 
state is absolutely separate from possibly storing
a column value.  It's "extra" bytes in the sense 
that it doesn't happen in a table where no
columns are nullable.

I once saw a database that was mangled somehow 
so that a NOT NULL column returned NULL in one row,
presumably because the bit was set that way.
That's at least very rare (at least after you
install Service Pack 1) unless your hardware 
lets you down - which ours sometimes has.

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