Batch View updates

Posted by Terry on Stack Overflow See other posts from Stack Overflow or by Terry
Published on 2009-12-17T07:53:10Z Indexed on 2010/04/30 23:07 UTC
Read the original article Hit count: 414

Filed under:

I want to load a bunch of view definitions into SQL Server 2005 & 2008. I am using IF/ELSE logic to dynamically building Create or Alter statements that I then EXEC. This works fine. However, unless I get the order of the statements correct, I get errors if a view is dependent on another view that would be created in a later statement. Is there a way to turn of the valiation of the SQL statements until after they have all been entered? It seems like the worst of both worlds. SQL Server does late binding and so it won't propogate changes to tables and views, but you can't create a view without all the pieces being in place.

© Stack Overflow or respective owner

Related posts about sql-server