You are here: Re: Alter more than one view « MsSQL Server « IT news, forums, messages
Re: Alter more than one view

Posted by Damien on 01/05/07 08:19

--CELKO-- wrote:

> SQL Server is weird on this, but each VIEW statement has to be in a
> batch by itself. The reason is that VIEWs can be built on VIEWs, so
> you need to commit the first VIEW to do this.
>
> That also means you cannot end it with a semi-colon and have to have a
> keyword GO instead. That is another weird keyword in SQL Server; it
> says make a batch out of the preceding statements.

Hi Joe,

Since we're picking on your answer here, can I also point out that GO
is a keyword for query analyzer (by default) and for the command line
tools. It is *not* a keyword for SQL Server, and is never sent to the
server.

This becomes obvious if ever you try to comment out a batch of code
that includes GOs. Because Comments are intepreted by SQL Server, but
the GOs are interpreted by the tool, you'll get error messages galore
(unterminated comments, unexpected * found, etc), plus whatever is
batched within the GOs within the commented out block still get
executed.

Damien

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация