• Rune Bivrin (9/24/2010)


    However, looking the table in the question I'd probably remove the NULL-ability on the cell phone numbers. Nullable VARCHAR often doesn't make sense. Particularly when they are entered in a classic GUI. How do you diffrentiate between a NULL phone number and a zero-length phone number?

    See the reply by Toreador to see why the distinction between zero-length string and NULL can be very important.

    As to the GUI - though I'd never call the "edit table" interface in SSMS an example of a good GUI, it does show you one way to handle this. A NULL is displayed as NULL (in italics, to show the difference with the string value 'NULL'), where a zero-length string is displayed as an empty cell. To change a value to a zero-length string, you select the contents and hit the Backspace or Deletet key. To change a value to NULL, you hit (IIRC) Ctrl-0.

    I would not use the token NULL in an interface for end users, and I'd probably favor a button over a hard-to-remember key combo for setting a value to NULL, but you get the general idea.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/