Skip to content

Don’t do what the book says

The exam book for the Microsoft exam 70-444, Optimizing and Maintaining a Database Administration Solution Using Microsoft SQL Server 2005 has many deficiencies. But on page 435 it says:

“It is common practice to specify zero as the DEFAULT definition for numeric columns and N/A as the DEFAULT definition for string columns.”

Don’t do that Okay. Setting artificial column defaults is bad. You shouldn’t do that.

Set one for the numeric value if it makes sense in the model (e.g. an order must have a total) but don’t set some stupid text default for no reason. How will you know when someone has actually entered N/A as a value and when they have entered no value at all.

Anyone who does this should be forced to stare into Joe Celko’s disapproving eyes for a whole day.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*