all groups > sql server programming > march 2005 >
You're in the

sql server programming

group:

Command GO



Re: Command GO Kalen Delaney
3/21/2005 4:26:27 PM
sql server programming: Hi Frank

GO is not a SQL Command. It is used by the tool, Query Analyzer or osql, to
separate your code into separate batches, and then each batch is sent to SQL
Server, and parsed, optimized, compiled and executed separately. There are
rules about what can and cannot be in the same batch. Please read about
'batches' in the Books Online.

I am not sure exactly what you are asking in this post.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com


[quoted text, click to view]

Command GO Frank Dulk
3/21/2005 9:21:10 PM
would like to know because of " Go " in the command below:

ALTER TABLE clie ADD clie_ind_rest CHAR(1) NULL
go
UPDATE clie SET clie_ind_rest='N'
go
ALTER TABLE oper ADD oper_vl_cessao DECIMAL(17,2) NULL
go


Thank you!

Re: Command GO Frank Dulk
3/22/2005 9:13:08 PM
appeared another doubt.
Well, GO determines the end of each batch. OK.

In BOL:

"Assume there are 10 statements in a batch. If the fifth statement has a
syntax error, none of the statements in the batch are executed. If the batch
is compiled, and the second statement then fails while executing, the
results of the first statement are not affected because it has already
executed."
(I understand that will be executed)



For my example above, with 3 instructions does make some difference I to
place GO at the end of each one?

Thank you!

"Kalen Delaney" <replies@public_newsgroups.com> escreveu na mensagem
news:OlNAaXnLFHA.3760@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

Re: Command GO Aaron [SQL Server MVP]
3/22/2005 10:38:44 PM
[quoted text, click to view]

Why don't you try it?
AddThis Social Bookmark Button