Steve Jones - SSC Editor
October 19, 2015 at 8:27 pm
Comments posted to this topic are about the item Counting the Tally Table
Follow me on Twitter: http://www.twitter.com/way0utwestForum Etiquette: How to post data/code on a forum to get the best helpMy Blog: www.voiceofthedba.com
October 19, 2015 at 11:46 pm
I'm not a DBA and I need to understand this.
When I executed that query in SSMS, it gave an error - why does it not work when executed like that?
October 19, 2015 at 11:54 pm
This was removed by the editor as SPAM
October 20, 2015 at 2:10 am
What version of SQL Server Management Studio are you using, Daleen?
Inserting multiple value lists is only possible from SQL Server 2008 onwards, so if you are running SQL Server 2005 or earlier you will receive an error ("Incorrect syntax near the keyword 'VALUES'.")
October 20, 2015 at 2:28 am
I use SSMS 2012, but when I executed the query, I was connected to a SQL2005 server.
I ran it on my local host, which is on 2012, and it worked and brought back the 30 rows as what the awnser says it should 🙂
October 20, 2015 at 4:14 am
Nice question. Thanks for sharing
October 20, 2015 at 5:00 am
Thank you for the question about tally tables. While they're common to me, I know that not everyone uses them, but it's an awesome tool to have in your toolbox.
Tally Tables - Performance PersonifiedString Splitting with True PerformanceBest practices on how to ask questions
October 20, 2015 at 5:04 am
Daleen (10/20/2015)Hi, MartinI use SSMS 2012, but when I executed the query, I was connected to a SQL2005 server.I ran it on my local host, which is on 2012, and it worked and brought back the 30 rows as what the awnser says it should 🙂Thank you.RegardsDaleen
This query uses a table value constructor, which didn't come along until SQL 2008. The MSDN page is at https://msdn.microsoft.com/en-us/library/dd776382.aspx.
October 20, 2015 at 5:27 am
October 20, 2015 at 5:28 am
Nice 😉 Welcome to Cartesian join.
October 20, 2015 at 6:47 am
Thanks for the good question, Steve.
Welcome to the forum, Daleen!
October 20, 2015 at 9:02 am
One of those days when I click submit and then say, "No, no. That's not what I meant."
October 20, 2015 at 9:07 am
Nice question Steve. I don't use tally tables much but they sure are a nice option to have.
October 20, 2015 at 11:34 am
Use them a lot. Easy question, didn't even need to run to verify.
October 20, 2015 at 1:36 pm
Cheers for that, it seems I can still do math!!! 🙂
Viewing 15 posts - 1 through 15 (of 17 total)
You must be logged in to reply to this topic. Login to reply