|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,040,
Visits: 1
|
|
| Comments posted to this topic are about the Question of the Day for 27 Jan 2006 posted at http://www.sqlservercentral.com/testcenter/qod.asp?QuestionID=695.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, November 10, 2011 5:55 AM
Points: 293,
Visits: 34
|
|
The semicolon is not a batch separator, it is the end of statement character. However, it is not required because the SQL language is specified using Bacus-Naur Form or BNF.
It is possible when parsing a statement or batch to examine the current statement token and the next statement token, compare them against the BNF definition of the language and determine whether the end of statement has been reached or not without the use of the semi-colon.
The only batch separator in SQL 2000 is the GO statement which as it happens is not part of the SQL language.
Stephen Bailey
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 12:02 PM
Points: 5,243,
Visits: 7,055
|
|
Stephen is correct. The semicolon is a command seperator; GO is a batch seperator. Though the semicolon is completely optional in SQL Server 2000, this changes in SQL Server 2005. In some cases (especially before a CTE), using a semicolon is required. Best, Hugo
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, September 15, 2008 12:02 PM
Points: 1,318,
Visits: 57
|
|
Don't the 100+ ppl who go this wrong have access to Query Analyzer? A cut/paste/execution lasting 5 seconds and you have the answer. No offense meant! Terry
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Friday, September 17, 2010 1:38 PM
Points: 402,
Visits: 8
|
|
| I am sure they do... But that defeats the purpose of seeing if you know the answer just by reading it. I don't look it up in the BOL's first either. More fun to guess since my job does not depend on me getting all the answers correct (Thank God!)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
|
|
i dont think this question is worth of 2 points.. explanation is also wrong.. GO is a batch seperator while semi-colon is a command seperator
|
|
|
|