THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

White elephant gift exchange for DBAs

In the holiday season, white elephant gift exchanges are somewhat popular in the workplace. This is a really great definition from Wikipedia: "the term white elephant refers to a gift whose maintenance cost exceeds its usefulness." Now that definitely describes some databases I've seen!

We can do a white elephant gift exchange of worst schemas. Here's my white elephant constructed of snippets from real production databases:

create table [table] (

   [column] varchar(1)  --think Hungarian notation without abbreviations

 , [count] decimal(10,0)  --integer value that might someday be 3 billion

 , replicationId varchar(40)  --this was for storing a uniqueidentifier

 , acomodation varchar(50)  --can we add spellcheck to SSMS, please?

 , seperationStatus varchar(50)  --odd how many columns match the default length

 , worseThanEAV xml

);

Do you hate brackets? I do! I really hate brackets when people use them to allow keywords and reserved words to be used for other purposes. I can see someone specifying decimal(10,0) instead of int, but other evidence made me suspect that the person didn't understand data types at all. Object names that are misspellings of ordinary words tend to cause the literate members of the staff to make errors. Don't you wonder about the design of a database in which most varchar columns are the same as the default width?

I really liked the varchar(1) that I saw in a table definition. I can't wait to hear the justification for that.

There was a recent blog post on EAV and quite a bit of discussion on that topic. The xml data type is a good companion to discussions about EAV. If you just can't quite finish your data model, be it third normal form or EAV (notice that the word normal is never used with the abbreviation EAV - ponder than one for a bit), you can always organize your data as XML and cram it into a table.

 

Published Wednesday, November 25, 2009 9:30 PM by John Paul Cook

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

GrumpyOldDBA said:

and one of my favourites    IsDeleted bit null,

November 30, 2009 10:55 AM

Leave a Comment

(required) 
(required) 
Submit

About John Paul Cook

John Paul Cook is both a Registered Nurse and a Microsoft SQL Server MVP experienced in Microsoft SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. Experienced in systems integration and workflow analysis, John is passionate about combining his IT experience with his nursing background to solve difficult problems in healthcare. He sees opportunities in using business intelligence and Big Data to satisfy healthcare meaningful use requirements and improve patient outcomes. John graduated from Vanderbilt University with a Master of Science in Nursing Informatics and is an active member of the Sigma Theta Tau nursing honor society. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2.
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement