|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:21 AM
Points: 5,244,
Visits: 7,062
|
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Yesterday @ 6:30 AM
Points: 3,192,
Visits: 4,151
|
|
Nice and easy question. I am very surprised that by now I am the only one (out of twenty) with the correct answer 
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 12:06 AM
Points: 849,
Visits: 323
|
|
The space used to store nullable fields is the only bottleneck. I missed it.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, January 08, 2013 5:51 AM
Points: 145,
Visits: 140
|
|
A good question!
It was not easy to get it right, I really learned something.
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 3:46 AM
Points: 1,631,
Visits: 2,031
|
|
whoop whoop! I learnt something  But I got the answer wrong
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 1:03 AM
Points: 10,990,
Visits: 10,543
|
|
Good question. The explanation could have been improved very slightly:
"SQL Server will use the same amount of storage for a column whether its value is NULL or a "real" value."
This is true for fixed-length types (both DATETIME and NCHAR used in the example are fixed-length) but variable length columns e.g. of VARCHAR type use no room in the data row - the null bitmap is used to distinguish between NULL and an empty string.
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 1:47 AM
Points: 778,
Visits: 1,047
|
|
Nice question.Hough difficult for me.Really learnt something thanks.
“When I hear somebody sigh, ‘Life is hard,’ I am always tempted to ask, ‘Compared to what?’” - Sydney Harris
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Yesterday @ 9:01 AM
Points: 71,
Visits: 81
|
|
Really enjoyed this question .. pity I got it wrong but I have definitly learnt something!:
Lucy Dickinson BI SQL Developer
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:21 AM
Points: 5,244,
Visits: 7,062
|
|
Thanks, all, for the kind words!
SQL Kiwi (11/9/2011) Good question. The explanation could have been improved very slightly:
"SQL Server will use the same amount of storage for a column whether its value is NULL or a "real" value."
This is true for fixed-length types (both DATETIME and NCHAR used in the example are fixed-length) but variable length columns e.g. of VARCHAR type use no room in the data row - the null bitmap is used to distinguish between NULL and an empty string. Good addition, Paul. For varying length data, my explanation is technically still correct, but indeed incomplete. For varying legth data, NULL takes the same amount as the shortest possible "real" value (which is teh empty string for varchar and nvarchar, and a zero-length binary string for varbinary).
Advance warning as a special service for those who take the time to read the discussion - the next question in this series (scheduled to go live in about a week) will involve some heavy arithmetic!
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Today @ 1:03 AM
Points: 10,990,
Visits: 10,543
|
|
Hugo Kornelis (11/9/2011) Advance warning as a special service for those who take the time to read the discussion - the next question in this series (scheduled to go live in about a week) will involve some heavy arithmetic! Oh joy!
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|