Not sure what the text editor you used may have done to you, but there's a lot of missing spaces in your code... for example CREATE TABLE has become CREATETABLE and SET @variable has become SET@variable. There are many other accidental concatenations throughout the code. It might be why there's not much discussion or rating on this article, so far... people just don't wanna take the time to fix posted code.
Also, you may want to add a link to your article on how to build your numbers table... it would help people that just don't know about such things, a lot. Either that, or it's short enough to just use in the code.
Contact Steve Jones for how to edit your article if you're interested in doing such a thing. It's not difficult and Steve is very happy to help on these things.
I've not played with the idea of an NVP (Name Value Pair) table like this for a calendar table. It's an interesting and different idea... it certainly makes indexing it a breeze and I'm gonna play with it and see how it does against more traditonal calendar tables. One of the things I'm going to play with, is the idea of using the clustered index to "partition" the dates in groups by the dimension column whilst including the date as the second column and, maybe, trying to do a partioned view on it. Like I said, it's an interesting and different idea.
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
"Change is inevitable... change for the better is not".
"If "pre-optimization" is the root of all evil, then what does the resulting no optimization lead to?"
How to post code problems
How to Post Performance Problems
Create a Tally Function (fnTally)