If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Interval Type

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-11, 16:25
gurzynski gurzynski is offline
Registered User
 
Join Date: Dec 2011
Posts: 8
Interval Type

Has anyone tried to implement a time interval type in the form of a user defined type in SS2k8r2? Specicifically an interval type described in the book Temporal Data and the Relational Model by C. J. Date et al.

As an example, an interval is below:

1/4/2006:1/10/2006

which would mean the time period from 1/4 to 1/10.
Reply With Quote
  #2 (permalink)  
Old 12-07-11, 17:52
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,280
Lightbulb

After having tried to use UDF's, I never use them again. I even stopped attempting to do so.

I would create two DATE columns, a FromDate and a TillDate to model a time interval. But then again, I am not C.J. Date. I could do whatever I wanted to do with them, and it would work and keep on working, but it is not a UDF, and as a consequence, a bad and retarded way to do things.
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
  #3 (permalink)  
Old 12-17-11, 14:48
gurzynski gurzynski is offline
Registered User
 
Join Date: Dec 2011
Posts: 8
User Defined Type

Wim discussed a User Defined Function, not a User Defined Type, which is quite different from what I am trying to do.

Implementing an interval type would drastically change the BI landscape. You wouldn't have to create a "cube" and create the messy SQL extension to handle it.
Reply With Quote
  #4 (permalink)  
Old 12-17-11, 15:58
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,280
Quote:
Wim discussed a User Defined Function, not a User Defined Type, which is quite different from what I am trying to do.
I'm sorry. I made a typo. There is nothing wrong with using User Defined Functions (UDF), I was definitely talking about User Defined Types (UDT). Perhaps there is a way to work efficiently with UDT's, but I haven't found it.

Let me correct my previous post:
Quote:
After having tried to use UDT's, I never use them again. I even stopped attempting to do so.

I would create two DATE columns, a FromDate and a TillDate to model a time interval. But then again, I am not C.J. Date. I could do whatever I wanted to do with them, and it would work and keep on working, but it is not a UDT, and as a consequence, a bad and retarded way to do things.
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
Reply

Tags
interval type, udt

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On