November 24, 2014 at 2:19 am
We're in the process of preparing a data extract for another company prior to them taking over our business. One of the things they have asked us to do is provide a time column as what is essentially an INTEGER but without of the logic you'd associate with that i.e. consecutive numbers. They want one minute past midnight as 1, seven AM as 700 and seven PM as 1900. 07:01 would thus be represented as 701. Rumour has it they're an Oracle company so I don't know if that is the reason behind it but I just can't understand why anybody would think this is good idea. They're also building the system from scratch so it's not like they have to cope with legacy problems. Can anybody suggest why they'd do this?
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
November 24, 2014 at 2:28 am
Because they don't understand the importance of good data types.
Because they've been taking design lessons from MSDB.
Because they don't realise that SQL 2008 has a TIME data type and don't want a date associated with this time
Only reason I'd ever put a time as an integer is when it's a timespan, a number of minutes, hours, etc. For points in time, there's the TIME data type.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 24, 2014 at 2:35 am
I wondered if it's to handle timespans. What we're doing is heavily connected to lengths of time and the duration of various things. I could understand if they wanted the times as 1 to 1440 consecutively; jumping from 59 to 100 at 0100 just baffles me.
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
November 24, 2014 at 2:37 am
They're using the same method of storing times as MSDB does. It's hell to work with unless all you want to do is display.
It's likely a case that they don't want dates in their times and don't know about the TIME data type. I'd suggest you ask them for reasons and get some explanations.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 24, 2014 at 2:47 am
Thanks Gail.
It's hard to ask why they want things because of the dark politics of what's going on. We have to keep things very much at arms length so our company doesn't get its fingerprints on any future cock-ups because they will be squarely hung on us no matter whose fault they are. That makes it very difficult to act when we see something we know is wrong. If we don't act there's a risk of being blamed for not telling them, if we do act there's a risk to our IP and being blamed when what we suggested doesn't work. What you say about display makes it even more confusing because the company asking for the time data will simply be passing information on to a third party who will do the work.
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
November 24, 2014 at 4:15 am
Even when building the system from scratch they may be using old libraries or tricks they aren't willing to give up. Radix 60 arithmetic or something.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply