SQL Server - Must be first statement in query batch - what and why?
From http://msdn.microsoft.com/en-us/library/ms175502(v=sql.105).aspx


  Rules for Using Batches
  
  The following rules apply to using batches:
  
  
  CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE
  SCHEMA, CREATE TRIGGER, and CREATE VIEW statements cannot be combined
  with other statements in a batch. The CREATE statement must start the
  batch. All other statements that follow in that batch will be
  interpreted as part of the definition of the first CREATE statement.
  A table cannot be changed and then the new columns referenced in the
  same batch.
  If an EXECUTE statement is the first statement in a batch,
  the EXECUTE keyword is not required. The EXECUTE keyword is required
  if the EXECUTE statement is not the first statement in the batch.