SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Are we in all these cities?


Are we in all these cities?

Author
Message
ronmoses
ronmoses
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1219 Visits: 996
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

Tom Garth
Tom Garth
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1239 Visits: 1499
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

ronmoses
ronmoses
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1219 Visits: 996
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

Hugo Kornelis
Hugo Kornelis
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10854 Visits: 11971
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
dave.farmer
dave.farmer
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1217 Visits: 784
...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!).
Tom Garth
Tom Garth
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1239 Visits: 1499
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

Jim Sleeman-388184
Jim Sleeman-388184
SSC-Enthusiastic
SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)

Group: General Forum Members
Points: 102 Visits: 179
Trick question! We shouldn't be testing syntax. What a waste of time!

Angry
Sean Lange
Sean Lange
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25886 Visits: 17512
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 Modens 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)
mtassin
mtassin
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4794 Visits: 72518
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 Tongue



--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
SanjayAttray
SanjayAttray
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4369 Visits: 1619
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search