home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,659 of 19,505   
   Gene Wirchenko to esquel@sommarskog.se   
   Re: When to Use GO   
   31 May 12 10:07:01   
   
   From: genew@ocis.net   
      
   On Thu, 31 May 2012 07:29:17 +0000 (UTC), Erland Sommarskog   
    wrote:   
      
   >Gene Wirchenko (genew@ocis.net) writes:   
   >>      I have a script where I very early delete the database and   
   >> recreate it.  In one recent problem area, I create a procedure.  It   
   >> has a GO in front of it, because stored procedures have to be first in   
   >> a batch.  Fine.  If I then follow with a CREATE TABLE in the same   
   >> batch,   
   >   
   >You can't. That CREATE TABLE is part of the procedure. CREATE PROCEDURE must   
   >be the first command in the batch, and it is the only command in the batch,   
   >a property it shares with a couple of more commands.   
      
        I have not read anything stating about a CREATE PROCEDURE having   
   to be the only command in a batch.  But, as my post shows, I have   
   discovered it myself.  Curse incomplete docs.   
      
   >Again, put your source code under version-control and load the files from   
   >a client-side program. Then you don't need to ask these questions.   
      
        I am experimenting in SSMS.  I do not want the overhead.   
      
   Sincerely,   
      
   Gene Wirchenko   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca