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

Posted by Alex Kuznetsov on 01/05/07 14:47

Erland Sommarskog wrote:
> Alex Kuznetsov (AK_TIREDOFSPAM@hotmail.COM) writes:
> > --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.
> >>
> >
> > Incorrect. MS SQL Server does not commit DDL right away (Oracle does).
>
> Joe may have a point, even if did not hit the nail perfectly. Up to
> SQL 6.5, there wasn't any deferred name resolution, so something like:
>
> CREATE VIEW innerview AS SELECT 12 AS gurka
> CREATE VIEW outerview AS SELECT gurka FROM innerview
>
> would fail at compilation. For tables there were some special plumbing
> to permit you to create a table and refer to it in the same batch, but
> I guess they never found that worthwhile for views.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Yeah, right, his post makes more sence if one replaces 'commit' with
'submit'.

-----------------------
Alex Kuznetsov
http://sqlserver-tips.blogspot.com/
http://sqlserver-puzzles.blogspot.com/

 

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

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