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 ««12345»»»

Are we in all these cities? Expand / Collapse
Author
Message
Posted Tuesday, July 13, 2010 5:34 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 893, Visits: 888
I saw the semicolon, said "well that looks wrong," and then proceeded to ignore it completely and got the answer wrong. Shows how smart I am.

-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown
Post #951327
Posted Tuesday, July 13, 2010 6:37 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, February 4, 2011 7:20 AM
Points: 977, Visits: 1,499
I got it right for the wrong reason. I didn't notice the semi-colon, and since A. would not have been a complete answer, I chose C. which amounted to "None of the above."

I've only used semi-colons for multiple short statements on a single line. I've never heard any pros or cons regarding using them or not using them.


Tom Garth
Vertical Solutions

"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
Post #951378
Posted Tuesday, July 13, 2010 6:40 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 893, Visits: 888
Tom Garth (7/13/2010)
I've only used semi-colons for multiple short statements on a single line. I've never heard any pros or cons regarding using them or not using them.

As I understand it, MS considers their use to be "best practice" but the only times I'm aware of actually needing them is the case you mentioned, and any time you use a CTE -- you have to end any preceding statement with a semicolon.

ron


-----
a haiku...

NULL is not zero
NULL is not an empty string
NULL is the unknown
Post #951381
Posted Tuesday, July 13, 2010 6:44 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 3:56 PM
Points: 6,086, Visits: 8,354
Tom Garth (7/13/2010)
I got it right for the wrong reason. I didn't notice the semi-colon, and since A. would not have been a complete answer, I chose C. which amounted to "None of the above."

Why do you think A would not have been a complete answer?

I've only used semi-colons for multiple short statements on a single line. I've never heard any pros or cons regarding using them or not using them.

They are already required before some new language constructions (like WITH). But Microsoft has also announced that the optionality of the semicolon seperator will disappear in a future version. So in a few years time, it will be mandatory to terminate EVERY statement with a semicolon. (Like almost all other computer languages).



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #951386
Posted Tuesday, July 13, 2010 6:44 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, June 11, 2014 9:54 AM
Points: 912, Visits: 654
...and the point is...?

Not a test of anything as far as I can see. If I add unwanted punctuation my mistake I get an error and remove it, I'm not going to learn anything from that other than that my fingers are too big for my keyboard.

As most others, I was looking at the logic of the question, not the quality of typing (and plenty of QotDs have had typos - we all know to look past them!).
Post #951387
Posted Tuesday, July 13, 2010 6:52 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, February 4, 2011 7:20 AM
Points: 977, Visits: 1,499
Hugo Kornelis (7/13/2010)
Tom Garth (7/13/2010)
I got it right for the wrong reason. I didn't notice the semi-colon, and since A. would not have been a complete answer, I chose C. which amounted to "None of the above."

Why do you think A would not have been a complete answer?

It's just me Hugo. I felt that in the context of the question without the semi-colon issue, the answer provided with A. was lacking. As in - what is the question trying to point out, or what is there to learn from this. That's all.


Tom Garth
Vertical Solutions

"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
Post #951396
Posted Tuesday, July 13, 2010 7:07 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 18, 2013 9:05 AM
Points: 100, Visits: 179
Trick question! We shouldn't be testing syntax. What a waste of time!

Post #951418
Posted Tuesday, July 13, 2010 7:17 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 3:08 PM
Points: 13,206, Visits: 12,687
I was completely stumped by the answer choices. Like everyone else I missed the semicolon in the subquery and was focused on trying to figure out which of the other answers would be close enough to get it right. The closest "correct" answer was A but it left off the count.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #951429
Posted Tuesday, July 13, 2010 7:31 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: Tuesday, September 30, 2014 7:42 AM
Points: 3,688, Visits: 72,435
Add me to that boat. I didn't even see the semi-colons... I've trained myself to ignore them when they aren't required... and since we didn't need one at all for that statement... I missed it. :/

Spent too much time looking at the logic of the query... not fxing stpd typ0s :P




--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
Post #951442
Posted Tuesday, July 13, 2010 7:51 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, July 17, 2014 10:56 AM
Points: 3,924, Visits: 1,607
Well, there had been many instances when the QOD query was wrong and it was corrected later. I thought so and ignored " ; " in syntax in sub query.

SQL DBA.
Post #951451
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse