SQL Server – Go Transact sql command

In sql server, we can find the number of options to generate dummy data in the table for testing purpose on test server. By using T-SQL Batch script, we can insert millions of records in no time. Bulk insert is the another option available in the sql server which allows to upload bulk data in the table. “GO” is the alternative option to execute the batch script in the loop

We will generate dummy data by using “GO” option in the sql server without using any batch script and bulk insert option. It will execute the T-SQL statement untill the count reached to the specific number.

Syntax: select * from batchExecutiontbl

GO 5 (The execution will continue upto 5 times)

Lets go through the example

create table dummytbl

(col1 varchar(20))


Insert into dummytbl values(‘data’)
Go 5


Beginning execution loop

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

Batch execution completed 5 times.

Leave a Reply




− 1 = 0