Mostly it's probably held over from old 3GL languages like COBOL, which
tended to treat just about everything as a series of characters. A lot of
financial companies/banks/government agencies/etc. are still running off
that old COBOL code, modified slightly for 4-digit years in 1999. All this
adds up to carrying over idosyncracies that 'made sense at the time', but
are completely useless in a modern DBMS with strongly typed columns.
My major complaints about the holdovers from the old 3GL's include:
-Naming conventions. Ever wonder why every programmer in the universe uses
the letter 'i' to represent a loop counter variable in every program they
ever write? It's FORTRAN's fault. Or why people name tables tbl_Table? We
know it's a table, so why the asinine prefix "tbl_"?
-Spaghetti-code. T-SQL makes it very easy to write un-manageable code.
-CURSORS. Unfortunately programmers tend to think problems through in terms
of procedural, iterative loops of code. SQL is a declarative set-based
language. 99.9999999999999999999...% of the things people write cursors and
exotic loops to accomplish can be done several orders of magnitude faster
and simpler using SQL's set-based operations. A big thank you goes out to
all the old COBOL programmers who couldn't wrap their minds around 'SELECT'
for this one.
Like I said, the carry-over of '003' might be to allow the application to
interface with some arcane datasources that would otherwise require CASTing
and appending the lead 0's on the front with every statement. I'm not
familiar with your particular situation, but converting it to a SMALLINT
could mean you have to do something like this:
SELECT *
FROM New_Data INNER JOIN Archaic_Data
ON RIGHT('000' + CAST(New_Data.Column1 AS VARCHAR(3)), 3) =
Archaic_Data.Column1
Then again, maybe the DBA's and application programmers are just lazy...
[quoted text, click to view] <aaron.kempf@gmail.com> wrote in message
news:1118854543.457367.26760@o13g2000cwo.googlegroups.com...
> yeah i know that i just dont get why 50% of the db people in the world
> aren't outraged by this
>
> i think that this is a crime against databases
>
> storing a numeric field as text?
> i just dont get it-- why do people let it happen?
>
>
> is it all from IBM?
>
> is this all oracles fault?
>
> screw leading zeros
>