|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 11:30 AM
Points: 1,495,
Visits: 1,507
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 12:39 PM
Points: 1,662,
Visits: 1,708
|
|
IMHO, this question does not really illustrate "the point that a subquery cannot be terminated with a semicolon". Semicolons terminate the statements and since the subquery is not the whole statement, it is rather obvious that it cannot be terminated. This question rather falls into a nasty category of those questions where the readers are suggested to use, as Hugo once aptly put it, "psychic powers" to figure out whether the author of the question meant to introduce a simple syntax error or such error is simply a result of an oversight.
Oleg
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: 2 days ago @ 3:21 AM
Points: 1,843,
Visits: 971
|
|
I got wrong.Because i did not observe the semicolon.
Malleswarareddy I.T.Analyst MCITP(70-451)
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 11:51 AM
Points: 5,232,
Visits: 7,023
|
|
I got it wrong too. I was looking at the logic of the query and the subquery, not at all the fine punctuation details.
Learned nothing from this question. This is the kind of error (typo) that people make now and then - and then the error message will quickly help you figure out what's wrong.
I don't mind questions about errors commonly made in T-SQL, or about errors that are hard to figure out due to how the parser presents the error. But I have never seen anyone use a semicolon in a subquery. And if someone does use it, the error message is clear: "Incorrect syntax near ';'." - and if you double-click the error message, you are taken to the line with the offending semicolon.
I hope the author will stop by and tell us what he/she was trying to teach us with this question. Maybe I missed the deeper issue here.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 1:49 AM
Points: 3,123,
Visits: 4,310
|
|
Interesting question - illustrates the point: read everything carefully before doing, otherwise rework might be the order of the day.
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: 2 days ago @ 4:24 AM
Points: 1,158,
Visits: 642
|
|
Sorry, but I think this only checks if you've read the question properly.
I think everbody KNOWS you don't put a semi colon in the middle of a query (no matter how many people get the question wrong).
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 1:01 PM
Points: 9,367,
Visits: 6,463
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Saturday, February 02, 2013 5:42 AM
Points: 190,
Visits: 74
|
|
Interesting!! victim was ;..........
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Thursday, April 21, 2011 5:47 AM
Points: 733,
Visits: 64
|
|
Lousy question, if you ask me ....
It encourages us to copy and paste the question into the query editor in order to avoid little misreadings. I don't think this is the appropriate way to answer questions which are supposed to teach us something.
I don't have AdventureWorks installed on any instance, so, after concluding that it should be "return all records" I tried a similar query on our own contacts table, typing the statement manually and (of course!) not making such a mistake!
If you can't do things the way they must be done, do them the way you can ...
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 3:37 AM
Points: 3,691,
Visits: 957
|
|
Well, got it wrong to. Not that it matters, but this is more a "proofreading" question than anything else. I haven't submitted any QOD myself, so i shouldn't complain... But did it anyway
Lars Broberg Elbe-Data AB
|
|
|
|