Closed majidbigdeli closed 3 years ago
Hello.
This is not a valid instruction in T-SQL. This is an instruction specific to some tools, such as sqlcmd, ssms and osql. Microsoft's OLEDB driver does not make it work either. This instruction is interpreted on the client side, before anything is done with the driver. And it is never sent to the server.
See : https://docs.microsoft.com/sql/t-sql/language-elements/sql-server-utilities-statements-go
"GO" isn't T-SQL. It is processed by the client.
You can emulate this with the "batch" package. https://pkg.go.dev/github.com/denisenkom/go-mssqldb/batch
conn.ExecContext(context.Background(), query)
i get error "Incorrect syntax near 'GO'."