Why should I use the GO command in sybase?

Why should I use GOsql for sybase when writing? Most existing sql in my project does not have GO, but when the DDL is created to create a table, as an example, the application inserts many GO statements.

Thanks to the answers, I understand that it GOis similar to ;in other databases, as people willingly indicated that it is a delimiter.

Added question, i.e. GOin sybase, exactly equivalent to type ;in Oracle?

+5
source share
4 answers

This is a batch separator. GOused to force the engine to process everything after the word GOas a new command in a package.

CREATE PROC usp_blah as ...
GO

CREATE some-otherproc as ...
GO

Without the GOoptimizer will throw an error in the second expressionCREATE

+9
source

For comparison:

    Do something
    GO
    Do something else
    Go

To:

    Do something
    Do something else

If in the first example an error occurred during "Do something", then "Do something else" will be executed. In the second example, this is not so. And, as Stuart pointed out, there are some actions that require this to be the first statement of the party, which means that you need to place GO in front of them if they are not the first line of your file.

+3
source

GO - SQL

[gG] [oO] go.

+1

go SAP/Sybase Transact-SQL.

, T-SQL .

SAP/Sybase isql, go isql T-SQL, ASE - (go , ).

, isql .

+1

All Articles