Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss Content Posted by Jeff Moden
»
Create a Tally or Numbers Table
36 posts, Page 1 of 4
1
2
3
4
»
»»
Create a Tally or Numbers Table
Rate Topic
Display Mode
Topic Options
Author
Message
Jeff Moden
Jeff Moden
Posted Wednesday, March 12, 2008 1:15 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 32,906,
Visits: 26,790
Comments posted to this topic are about the item
Create a Tally or Numbers Table
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #467926
Jeff Moden
Jeff Moden
Posted Tuesday, April 01, 2008 7:26 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 32,906,
Visits: 26,790
Heh... I love it... someone gave me the ultra low mark of 1 star and didn't even have the nerve to tell me why.
Would it help if I told you that the method I used creates a million rows in about 5 seconds?
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #478182
Anipaul
Anipaul
Posted Tuesday, April 29, 2008 2:31 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 4,787,
Visits: 1,336
Hi Jeff
Your code was no 1 that's why the person gave you 1. Why are asking for explanation?
Joke apart the article was fine. :)
Post #491903
Jeff Moden
Jeff Moden
Posted Tuesday, April 29, 2008 6:40 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 32,906,
Visits: 26,790
Heh... that's funny... hadn't thought of it that way, AnirBan. :D
I actually have an article coming out in the very near future as to "how and why" Tally tables work and and how then can be used to replace loops... the script here was just to make it easy for me to refer to when I post replies.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #492563
Anipaul
Anipaul
Posted Tuesday, April 29, 2008 10:11 PM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 4,787,
Visits: 1,336
Jeff Moden (4/29/2008)
Heh... that's funny... hadn't thought of it that way, AnirBan. :D
I actually have an article coming out in the very near future as to "how and why" Tally tables work and and how then can be used to replace loops... the script here was just to make it easy for me to refer to when I post replies.
I will definitely wait for your article........:)
Post #492610
PaulR-122207
PaulR-122207
Posted Wednesday, April 30, 2008 8:44 AM
SSC Veteran
Group: General Forum Members
Last Login: Wednesday, April 03, 2013 1:00 PM
Points: 231,
Visits: 261
Jeff, just so you know, I gave you a 5 because I didn't give you a 1, 2, 3, or 4, and 5 is the maximum. I just want to make sure you know the reason for my rating! :D
Kidding aside, I, too, will be awaiting your articles on usage of this table...
Post #493002
Jeff Moden
Jeff Moden
Posted Wednesday, April 30, 2008 9:15 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 32,906,
Visits: 26,790
Thanks guys... I sure do appreciate your feedback.
I just got word that it's coming out on May the 7th.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #493051
CELKO
CELKO
Posted Wednesday, April 30, 2008 9:48 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 11:11 AM
Points: 1,945,
Visits: 2,782
The only thing I would find fault with is that it is too proprietary -- IDENTITY, references to system tables.
I also call this table Sequence because that is what it is. It is not a Tally -- there is nothing being tallied. It is more than a set of Numbers -- it cannot have gaps and must start with 1.
The bad news is that SEQUENCE is now a reserved word in SQL:2003 for a generator function. Arrgh!
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #493090
Jeff Moden
Jeff Moden
Posted Wednesday, April 30, 2008 7:05 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 32,906,
Visits: 26,790
But, it
is
a Tally table... it's used to count. And, besides... as you've already found out ol' friend... Tally is not likely to ever be a reserved word. "Sequence" has been a reserved word in things like Oracle for a long time... ;)
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #493360
Jeff Moden
Jeff Moden
Posted Wednesday, April 30, 2008 7:16 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 32,906,
Visits: 26,790
And you actually believe in the myth of code portability? That'll only happen when no one creates their own extensions to the ANSI standards. :P
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #493362
« Prev Topic
|
Next Topic »
36 posts, Page 1 of 4
1
2
3
4
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.