On Fri, Jan 3, 2014 at 2:09 PM, Frank Cazabon <[email protected]>wrote:
> On 03/01/2014 04:01 PM, Jeff Johnson wrote: > >> Thanks Frank. I did not know that! I've been putting in the ";" forever. >> >> > The ";" is needed for VFP's version of SQL. > > It is not used in MS SQL Server. > > -------------- Well NO not at all. from < http://lextonr.wordpress.com/2012/09/26/gos-and-semicolons/> Aside from the potential that terminating T-SQL statements with a semicolon might be required in the nearish future, when else might it be needed? There are a few, specific instances, such as in the definition of a common table expression (CTE). A CTE is a T-SQL statement that resolves to a record set which, once defined, can be referenced multiple times, but only within the same scope. Additional information on CTEs is available here<http://msdn.microsoft.com/en-us/library/ms190766(v=sql.105).aspx>, and perhaps will be the subject of a future post within this forum. /* This fails because common table expressions are only valid within a statement (and a semicolon terminates a statement) */ PRINT 'Start'; WITH cte AS (SELECT 'Col1' = 1); -- add a semicolon here SELECT * FROM cte; It acts as a terminator to a line of command(s) much like GO does. But it is going to be more important going forward. -- Stephen Russell Sr. Analyst Ring Container Technology Oakland TN 901.246-0159 cell --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CAJidMY+-HBb0s7tgCeyre6EC4_JuEspnykjYHR-Apm=upts...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

