Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Build date table Expand / Collapse
Author
Message
Posted Thursday, December 9, 2010 3:34 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 12:42 PM
Points: 2,599, Visits: 3,936
Nils Gustav Stråbø (12/9/2010)
I'd like the link that tells us we can't run the t-sql before answering. I can't remember ever seeing that post anywhere.
That's cheating in my world


I suppose it would be cheating if this was for something meaningful such as money, a job, or a degree. But to collect points for fun is not something I'd worry about cheating for.

The important thing is to learn something; whether you run the code first, last, or not all shouldn't matter (IMO ).
Post #1032766
Posted Thursday, December 9, 2010 9:27 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, October 17, 2014 7:46 AM
Points: 5,364, Visits: 8,948
kevin.l.williams (12/9/2010)
Nils Gustav Stråbø (12/9/2010)

64% got it right. Yeah, right!! How many cheated and ran the T-SQL code?


I cheated and got it right!

By the way, how many of you read the forum comments and stop after you get to Hugo's?


Isn't that the way this works here?


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #1032825
Posted Friday, December 10, 2010 8:19 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 25, 2014 2:58 PM
Points: 3,173, Visits: 1,267
Hugo Kornelis (12/9/2010)
kevin.l.williams (12/9/2010)
By the way, how many of you read the forum comments and stop after you get to Hugo's?


If that number is significantly large, I'll have to consider postponing my comments, so that other valuable comments get read as well.

Thanks for the kind words!


HaHa, You will propbably never know the true number since my comment was after yours.



Post #1033040
Posted Tuesday, December 14, 2010 1:53 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, July 21, 2014 3:43 AM
Points: 1,939, Visits: 1,162
Good Question.good discussions

Malleswarareddy
I.T.Analyst
MCITP(70-451)
Post #1034240
Posted Tuesday, December 14, 2010 10:32 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 9:24 PM
Points: 17,807, Visits: 15,728
Thanks for the question.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1034577
Posted Thursday, December 16, 2010 6:37 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 11:12 AM
Points: 7,791, Visits: 9,545
Nils Gustav Stråbø (12/9/2010)
I don't like questions like this, and not because I got it wrong.
It teaches me nothing about Sql Server or T-SQL (except debugging peculiar T-SQL), and to be able to answer it correctly, without cheating, you will have to manually write down how many rows are inserted in each run of the loop in order to keep track of the number in the meaningless "SomeNumberForDate" column.


No, you don't need to do that.
You can see that 512 is greater than 365, so the last rows added have SomeNumberForDate = 256. Before that the last row added; and number of rows adsded before then was clearly 256 (it's all in poowers of two, obviously). There are 365 rows in all and and 256 with SomeNumberForDate 128 or less, and that leaves just 109 that have SomeNumberForDate = 256.
All you have to see is that the number of rows added each time is a power of 2, that the number of rows in teh table after each set is added is a power of 2, that there are 365 days in the year 2010, and that 512 is the smallest power of two greater than 365. No manually writing down meaningless numbers required.

I guess that learning to thing mathematically is a bit like learning to think set-oriented: is you don't learn it you end up doing things the hard way.

If it had been a question designed to check people's ability to do simple maths, it would have been a good question; but as it was apparently meant to teach something about SQL, it didn't achieve its objective. But there's some good SQL in the comments, so it was at least a useful question.


Tom
Post #1036249
Posted Sunday, December 19, 2010 9:21 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Sunday, November 17, 2013 11:53 AM
Points: 623, Visits: 237
Too big code i just ran the code. but yeah i did learned bit about date and then got lost...
Post #1037013
Posted Thursday, January 27, 2011 5:50 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, April 19, 2011 1:59 AM
Points: 1,042, Visits: 234
Good question followed by even better discussion.

Good learning for me.

Thanks Guys.
Post #1054496
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse