I know I'm old ...
-
.. and crotchety and lots of other things but there some things I'm not sure that I want to understand. I'm no longer brave enough to ask "Why?" There was a conversation in QA yesterday (Programming, data storage, database[^]) about storing numeric IDs as strings. Drives me to distraction and I'm obviously not alone Today I find a column at work called
ACTV_IND
. Hm, thinks I, could this column contain an indicator to state whether or not this item is currently "Active". Well, yes it does. Except instead of an "indicator" it contains the words "Yes" or "No". I was sort of expecting a char Y or N, or even a bit 1 or 0. But it's "Yes" or "No" .This in a database that has otherwise been normalized to death (oh yeah, there are max 5 "type" of record and each type is max 3 chars - but that has been normalized away into a separate table). At a site where they are talking about destroying historical data "to save storage space". Just when I thought it couldn't get any worse, I noticed the table schema has this as varchar(15). That's longer than the longest word I've ever heard of for "Yes"! (Urdu by the way - Dschii haan, except it wouldn't be in that alphabet, but there again varchar not nvarchar) I don't know what made me do it, perhaps some innate sadomasochistic streak, but I checked out the numeric Ids while I was there ... yep, they're all varchar(15) as well. :sigh: I'm just going to quietly write my query, get the data and get outta here. -
.. and crotchety and lots of other things but there some things I'm not sure that I want to understand. I'm no longer brave enough to ask "Why?" There was a conversation in QA yesterday (Programming, data storage, database[^]) about storing numeric IDs as strings. Drives me to distraction and I'm obviously not alone Today I find a column at work called
ACTV_IND
. Hm, thinks I, could this column contain an indicator to state whether or not this item is currently "Active". Well, yes it does. Except instead of an "indicator" it contains the words "Yes" or "No". I was sort of expecting a char Y or N, or even a bit 1 or 0. But it's "Yes" or "No" .This in a database that has otherwise been normalized to death (oh yeah, there are max 5 "type" of record and each type is max 3 chars - but that has been normalized away into a separate table). At a site where they are talking about destroying historical data "to save storage space". Just when I thought it couldn't get any worse, I noticed the table schema has this as varchar(15). That's longer than the longest word I've ever heard of for "Yes"! (Urdu by the way - Dschii haan, except it wouldn't be in that alphabet, but there again varchar not nvarchar) I don't know what made me do it, perhaps some innate sadomasochistic streak, but I checked out the numeric Ids while I was there ... yep, they're all varchar(15) as well. :sigh: I'm just going to quietly write my query, get the data and get outta here.Ouch. I was looking for the appropriate emoji thing to respond to this post with, but nothing quite fits. It does remind me of a time an otherwise brilliant (and self taught) programmer was doing all his
JOIN
s in PHP instead of in SQL. I got out of there, so I understand. There are simply wrong ways to use a database, although recently I *might* be guilty of that myself (as per my post at the top of the lounge at the moment) *hides*Real programmers use butterflies
-
.. and crotchety and lots of other things but there some things I'm not sure that I want to understand. I'm no longer brave enough to ask "Why?" There was a conversation in QA yesterday (Programming, data storage, database[^]) about storing numeric IDs as strings. Drives me to distraction and I'm obviously not alone Today I find a column at work called
ACTV_IND
. Hm, thinks I, could this column contain an indicator to state whether or not this item is currently "Active". Well, yes it does. Except instead of an "indicator" it contains the words "Yes" or "No". I was sort of expecting a char Y or N, or even a bit 1 or 0. But it's "Yes" or "No" .This in a database that has otherwise been normalized to death (oh yeah, there are max 5 "type" of record and each type is max 3 chars - but that has been normalized away into a separate table). At a site where they are talking about destroying historical data "to save storage space". Just when I thought it couldn't get any worse, I noticed the table schema has this as varchar(15). That's longer than the longest word I've ever heard of for "Yes"! (Urdu by the way - Dschii haan, except it wouldn't be in that alphabet, but there again varchar not nvarchar) I don't know what made me do it, perhaps some innate sadomasochistic streak, but I checked out the numeric Ids while I was there ... yep, they're all varchar(15) as well. :sigh: I'm just going to quietly write my query, get the data and get outta here. -
If you do not use a string as datatype for this column, how would you fit "FILE NOT FOUND" into it? :confused:
-
If you do not use a string as datatype for this column, how would you fit "FILE NOT FOUND" into it? :confused:
404 :confused:
Luc Pattyn [My Articles] If you can't find it on YouTube try TikTok...