Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1096

Re: When to Use GO

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver, microsoft.public.sqlserver.programming
Subject Re: When to Use GO
Followup-To comp.databases.ms-sqlserver
Date Thu, 31 May 2012 07:29:17 +0000 (UTC)
Organization Erland Sommarskog
Lines 22
Message-ID <XnsA0646084DCB3FYazorman@127.0.0.1> (permalink)
References <2q1ds719sl2jcedv0shaif16dvksgigkds@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Date Thu, 31 May 2012 07:29:17 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="G7+Jz22XqYCG8C6rb1H3YA"; logging-data="19593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xFmA+867E1+WV+kV1m687"
User-Agent Xnews/2005.10.03 Mime-proxy/1.4.c.4 (Win32)
Cancel-Lock sha1:w7dBMgn9nbFFbc2jJa2gQgO+4OU=
Xref csiph.com comp.databases.ms-sqlserver:1096

Cross-posted to 2 groups.

Followups directed to: comp.databases.ms-sqlserver

Show key headers only | View raw


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.

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.


-- 
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

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

When to Use GO Gene Wirchenko <genew@ocis.net> - 2012-05-30 14:21 -0700
  Re: When to Use GO Erland Sommarskog <esquel@sommarskog.se> - 2012-05-31 07:29 +0000
    Re: When to Use GO Gene Wirchenko <genew@ocis.net> - 2012-05-31 10:07 -0700
      Re: When to Use GO Erland Sommarskog <esquel@sommarskog.se> - 2012-05-31 22:26 +0200
        Re: When to Use GO Gene Wirchenko <genew@ocis.net> - 2012-06-01 09:41 -0700
          Re: When to Use GO Erland Sommarskog <esquel@sommarskog.se> - 2012-06-01 23:23 +0200
            Re: When to Use GO Gene Wirchenko <genew@ocis.net> - 2012-06-03 19:36 -0700
  Re: When to Use GO "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-05-31 06:45 -0400

csiph-web