If you are using SQL Server and saw a GO command in a T-SQL script and you do not know what that GO is used for,      this article is for you. I

SQL GO command in SQL Server

submited by
Style Pass
2021-05-20 13:34:36

If you are using SQL Server and saw a GO command in a T-SQL script and you do not know what that GO is used for, this article is for you. In this article, we will explain what the SQL GO command is when to use it, and some tips about using it.

SQL Server was based on the Sybase database (an old database system deprecated in 2014). SQL Server started with several system procedures from Sybase and after some years, it changed a lot with new different features, but the GO statement was one of the main commands in Sybase inherited by SQL Server and it is still used today.

The GO command is frequently used inside T-SQL code to use batches. It is not a T-SQL statement, but it is a command recognized by native SQL Server tools like the SSMS, the SQLCMD, and OSQL (SQLCMD is the command-line to handle SQL Server and osql is an old version of SQLCMD that may be removed someday).

To connect to sqlcmd you have to go to the command line and to enter with your windows credentials use the sqlcmd -E command. Then you can write sentences with the GO command which is mandatory.

Leave a Comment