|  | Posted by Hugo Kornelis on 01/09/07 21:56 
On Fri, 5 Jan 2007 23:13:00 +0000 (UTC), Erland Sommarskog wrote:
 >onedaywhen (jamiecollins@xsmail.com) writes:
 >> FWIW in SQL Server 2005 you can end a CREATE VIEW with a semi-colon but
 >> it must still be "the first statement in a query batch".
 >
 >And still be the only.
 >
 >(And I would suggest that ; is not a statement terminator in T-SQL - It's
 >statement initiator.)
 
 Hi Erland,
 
 I would have to disagree with that suggestion. The ; is statement
 terminator in ANSI, and has been the (optional) statement terminator in
 T-SQL since at least SQL Server 2000 (but I think it was allowed in
 earlier versions as well). The fact that *some* statements now require
 the preceding statement to be terminated doesn't change it into a
 statement initiator.
 
 Check out the location of the ; in the syntax diagrams in Books Online.
 
 --
 Hugo Kornelis, SQL Server MVP
 My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
  Navigation: [Reply to this message] |