• My two favorites:

    1. Worked at one client where they stored Guid's in image datatype. At least they understood Guids are binary and not text, but still had to do a cast anytime it was referenced. And, the value was a logically a foreign key that could not be indexed.

    2. Another client stored Xml data in a text datatype. Granted this database was originally designed before xml was a datatype in SQL Server, but was running on a server where we could have modified the table to use xml datatype. I had to implement an application enhancement to provide a count of certain types of elements in this xml data. Size of these values ranged from 200 characters to some over 10mb. Converting the text value to xml to do a XPath query for those rows that were over 10mb took 3-4 minutes. I ended up scheduling a SQL job to run a sproc to convert to xml then count using xpath, 100 rows at a time then end, then run the job every 5 minutes (to satisfy the dba that this wouldn't interfere with production). It took almost 4 weeks to run through all 18 million rows.



    Mark